title: gitlab CI + Docker + .NET Core, I don't understand why only an older .net version is installed
body: <p>I have a gitlab CI file that is building projects like this:</p>
  
  <pre><code>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 &amp;&amp; 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
  </code></pre>
  
  <p>The idea is to use docker/compose:1.25.1-rc1 to bring a docker-compose environment and build the files.</p>
  
  <p>The docker file itself is calling for this image to build</p>
  
  <blockquote>
    <p>FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as build</p>
  </blockquote>
  
  <p>and then uses this image for runtime:</p>
  
  <blockquote>
    <p>FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 as final</p>
  </blockquote>
  
  <p>so .net 3.1 should be installed.</p>
  
  <p>however, when I run the app, I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/Q67jJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q67jJ.png" alt="enter image description here"></a></p>
  
  <p>(I can't do a text capture, so this is a screenshot)</p>
  
  <p>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.</p>