Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

393
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!