I created a .net core 5 web api and planned to run using docker with Visual studio 2019. While trying to run api in docker end up with error,
Docker Desktop is not functioning as expected. Please try restarting Docker.
I was not able to run the application in windows my local system.
Well, I suppose you get this because your VS is not able to communicate with docker daemon which opens a net.pipe. To justify this try the below command in a command line:
>docker run hello-world
Regardless you have a "hello-world" container, if you get the following error: "Error response from daemon: open \.\pipe\docker_engine_windows: The system cannot find the file specified".
This means you are probably missing some Windows features. Run the following command from an elevated Powershell:
Enable-WindowsOptionalFeature -Online -FeatureName $("Microsoft-Hyper-V", "Containers") -All
Then it will ask to restart your computer, then docker stuffs shall work from VS.
I had this problem recently and used this GitHub issue which helped me solving the problem. Hope this helps on you too...
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