
Hi !
Time to share a weird experience on Windows 10 and Docker. Sometimes, usually after some Windows 10 update or even after a software installation, docker stop responding.
An typical error may look like this.
error during connect: This error may indicate that the docker daemon is not running.: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/build?buildargs=%7B%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile.amd64&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=noToday.azurecr.io%2FU%3A0.0.88-amd64&target=&ulimits=null&version=1: open //./pipe/docker_engine: The system cannot find the file specified.
From Visual Studio Code we get:

And it’s very weird. When I check the Docker desktop app, it’s stuck in the the STARTING state.

I can restart the docker desktop app, and I will still have the issue. As I said, weird.
I’m a handy man, so I decided to restart the docker service. Just 2 commands:
Net stop com.docker.service
Net start com.docker.service
However, this does not solve the problem. And sometimes, even restarting Windows won’t fix the problem.
After some time, I found the root cause:
Somehow WSL was set to version 1 instead of version 2.
I’m not sure why, however the solution is super easy. Just run a command to set WSL to version 2 and then restart docker service.
wsl --set-default-version 2
Net stop com.docker.service
Net start com.docker.service
If you are a visual person, this may look like this:

Important: you need to run these commands with Administrator privileges. So in a Windows Terminal world, this may also look like this. Right click on the Windows Terminal App, and click on “Run as administrator”.

ΒΏCon ganas de ponerte al dΓa?
En Lemoncode te ofrecemos formaciΓ³n online impartida por profesionales que se baten el cobre en consultorΓa:
- Si tienes ganas de ponerte al dΓa con Front End (ES6, Typescript, React, Angular, Vuejs…) te recomendamos nuestros MΓ‘ster Front End: https://lemoncode.net/master-frontend#inicio-banner
- Si te quieres poner al dΓa en Backend (stacks .net y nodejs), te aconsejamos nuestro Bootcamp Backend: https://lemoncode.net/bootcamp-backend#bootcamp-backend/banner
- Y si tienes ganas de meterte con Docker, Kubernetes, CI/CD…, tenemos nuestro Bootcamp Devops: https://lemoncode.net/bootcamp-devops#bootcamp-devops/inicio
2 comments