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

394
Visualizações
Build .NET Core Console Application into Docker

I created a new .NET Core Console Application with Visual Studio 2017 (RTM). Then added Docker support and got the docker file + compose files just fine. However there are few issues with them.

Docker compose files have version 2 which makes the build fail to the following error message

Microsoft.DotNet.Docker.CommandLineClientException: client version 1.22 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version.

This can be fixed by manually changing the compose file versions to 2.1. (not sure if valid fix) Then you'll get another error message

MSB4006 There is a circular dependency in the target dependency graph involving target "DockerCleanServiceReferences".

This I have no idea how to fix. I know the error message is due to some configuration that causes circular reference (e.g. post build event that does build)

So, any resources or tips how to package the .NET Core console application into docker container manually? I'm just getting to know Docker so don't assume I know anything of it yet.

Another question, that is there some place where I could get updated versions of these Visual Studio templates or are these known issues?

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

0

Can you please check if your Docker for Windows is targeting Linux? It's likely you were targeting Windows container, which is not supported with .NET Core yet.

about 4 years ago · Santiago Trujillo Relatório

0

It turned out the problem for me was having my DockerFile, SLN file, and CSPROJ file all in the same folder. You know how when you create a solution, it asks you if you want to create a subdirectory? If you do not, and your SLN and CSPROJ files share the same folder, inevitably the Docker files will be added to this same folder, creating the circular reference. If your SLN file lives in the directory above your CSPROJ file, the DockerFile et al will be put into your parent directory with the SLN file, and all will be well. This solved it for me.

about 4 years ago · Santiago Trujillo Relatório

0

On my first spin of VS2017 with docker, using the default template, I ran in to the same issue. I referred to this article - https://blogs.msdn.microsoft.com/containerstuff/2017/03/13/visual-studio-2017-client-version-1-22-is-too-old/ This is what worked for me - As recommended, made this changes in docker-compose project's docker-compose.ci.build.yml : The 'version' parameter on the top of the file which was set to 2, was change to 2.1 Repeated the same changes on the other files in the project including:

docker-compose.yml

docker-compose.override.yml

docker-compose.vs.debug.yml

docker-compose.vs.release.yml

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