Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
When, where and how does Visual Studio 2017 set the DOCKER_BUILD_SOURCE environment variable

When creating a new .NET core application with docker support in Visual Studio 2017 it creates a number of docker-compose.yml files. The docker-compose.vs.debug.yml and the release variant both contain contain a reference to an environment variable named DOCKER_BUILD_SOURCE:

version: '2'

services:
  app:
    image: app:dev
    build:
      args:
        source: ${DOCKER_BUILD_SOURCE}
    environment:
      - DOTNET_USE_POLLING_FILE_WATCHER=1
    volumes:
      - ./app:/app
      - ~/.nuget/packages:/root/.nuget/packages:ro
      - ~/clrdbg:/clrdbg:ro
    entrypoint: tail -f /dev/null
    labels:
      - "com.microsoft.visualstudio.targetoperatingsystem=linux"

The purpose of this variable seems to be a reference to the source directory, however, it always seems to be empty.

I was unable to find more detailed info on this subject... Does anyone have an idea or a pointer to some docs?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I believe it has to do with doing some setup that can be used with Visual Studio Team Services CI/CD. However when run locally, that value is empty and if you look at the docker file, you see that if the value is empty, it substitutes "obj/Docker/publish"

Dockerfile:

FROM microsoft/aspnetcore:1.0

ARG source

WORKDIR /app

EXPOSE 80

COPY ${source:-obj/Docker/publish} .

ENTRYPOINT ["dotnet", "app.dll"]

However for me, i don't actually see that folder or anything in it. Where the "magic" happens is in the volumes section. that essentially moves your code onto the container as a bind mound. this is where your code gets moved onto the container. There are a few other things that happen that aren't clear to me though because I see a line in the build output where the code gets built/published, but not the actual command that is running.

about 4 years ago · Santiago Trujillo Relatório

0

This has no real impact when building development images. As Nick explained we get code using bind mount.

This is used when building images for production use with file docker-compose.ci.build.yml, which outputs to obj/Docker/publish of each solution web project.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda