.Net Core 2 came out, so I updated Visual Studio 2017 (Community) to release 15.3.0 (and subsequently 15.3.2) which has support for Docker which I've installed on my machine (Windows 10), and I believe I've configured things correctly.
I created a basic Web API project—on .NET Core 2.0 without Docker—and that works. Now I add Docker support and I can't get it to run! I get the following error:
How do I debug this? The only other Q&A I found wasn't helpful. If you recognize the error, do you know how to fix it?
If you are having trouble with Docker containers or images, you can turn on debug mode on your Docker daemon. Enabling debugging provides more verbose output from the daemon and you can use this information to find out more about why your containers or images are having issues.
Right-click on the project node and choose Publish.... A screen showing deployment options appears. Choose Docker Container Registry, and then choose Docker Hub. Enter your Docker credentials.
The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment. It allows you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set.
Existing app Open the project in Visual Studio, and choose one of the following options: Select Docker Support from the Project menu. Right-click the project in Solution Explorer and select Add > Docker Support.
I was having the same issue. I found this forum post which suggests the fix is either:
The first suggestion did not work for me, but the second did. I probably didn't need to do this, but I also nuked my existing containers and images for the project I was working on.
The Visual Studio build process with Docker support enabled will automatically pull microsoft/aspnetcore:2.0 if the image is not found locally. So, it's easiest to remove the cached image and let the build process pull it down for you.
In order to see local images, from the command line:
docker images
If you see microsoft/aspnetcore:2.0, then remove the image from your local cache:
docker rmi microsoft/aspnetcore:2.0
After that, when you next build... all is good again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With