VS 2017 and Docker: Operation aborted

天涯浪子 提交于 2020-01-03 07:25:18

问题


.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?


回答1:


I was having the same issue. I found this forum post which suggests the fix is either:

  1. Reset the credentials on the shared drive settings for Docker
  2. Delete the [stale] microsoft/aspnetcore:2.0 image and pull the latest again from DockerHub

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.




回答2:


Same issue here, but aspnetcore 1.1 and I couldn't check the shared drive in Docker-Settings (Issue 579: https://github.com/docker/for-win/issues/579). I reinstalled Docker and now it works like a charm.



来源:https://stackoverflow.com/questions/45866441/vs-2017-and-docker-operation-aborted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!