1
votes

I have a gitlab CI file that is building projects like this:

image: 'docker/compose:1.25.1-rc1'
services:
    - 'docker:dind'
variables:
    GIT_SUBMODULE_STRATEGY: recursive

    stages:
        - build
        - deploy

    buildCode:
        stage: build
        except:
          - deploy
        script:
            - docker build -t dataserver -t ${CI_REGISTRY}/${CI_PROJECT_PATH}:latest -f dockerfile .

    deployCode:
        stage: deploy
        only:
          - deploy
        script:
            - docker build -t dataserver -t ${CI_REGISTRY}/${CI_PROJECT_PATH}:latest -f dockerfile .
            - docker login registry.gitlab.com -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
            - docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}:latest        
            - docker network create network && echo 'creating network'
            - docker-compose -f docker-compose.yml pull
            - docker-compose -f docker-compose.yml rm -f -s
            - docker-compose -f docker-compose.yml up -d

The idea is to use docker/compose:1.25.1-rc1 to bring a docker-compose environment and build the files.

The docker file itself is calling for this image to build

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build

and then uses this image for runtime:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 as final

so .net 3.1 should be installed.

however, when I run the app, I get this:

enter image description here

(I can't do a text capture, so this is a screenshot)

Which means that .net 3.1 is not installed and I can't figure out the problem. If I compile the app for 3.0, with the same CI setup, it runs.

1

1 Answers

0
votes

Try force a docker image pull of the images before build yours.

Seems your aspnet:3.1 Just had the 3.1.0-preview version when you pulled It.

The 3.1 tag aims always the last 3.1.xxx version.

Before release was the preview.. now is 3.1.0... in Future Will be 3.1.x.

If you already has pulled the image with the tag 3.1 your build will used the met image. And that may not be the current 3.1 in remote repository. If you pull It the hash is verified and will update the image If needed