Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Desktop is not functioning as expected. Please try restarting Docker

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.

like image 629
surji Avatar asked May 27 '26 02:05

surji


1 Answers

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

like image 121
Gergely Csikvári Avatar answered May 28 '26 15:05

Gergely Csikvári