I am a beginner at Docker. I need to create two containers for mongo and mongo-express. But, I'm getting an error as error during connect: This error may indicate that the docker daemon is not running.
Then I tried below steps:
I run the cmd as administrator. Then I run the command "C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
. It didn't work for me. then I tried with 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
way. Then I enabled hypervisor also. Still, I am getting the same error. When I ran the docker version command in cmd I received the below-mentioned outputs:
Then after I tried with cd "C:\Program Files\Docker\Docker"
and ./DockerCli.exe -SwitchDaemon
separately.
docker info
command gives below mentioned error:
C:\Windows\system32>docker info
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc., v0.10.0)
compose: Docker Compose (Docker Inc., v2.15.1)
dev: Docker Dev Environments (Docker Inc., v0.0.5)
extension: Manages Docker extensions (Docker Inc., v0.2.17)
sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
scan: Docker Scan (Docker Inc., v0.23.0)
Server:
ERROR: error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: Get "http:////./pipe/docker_engine/v1.24/info": open //./pipe/docker_engine: The system cannot find the file specified.
errors pretty printing info
CodePudding user response:
Did you install the Docker Desktop on your Windows PC? If not please install it and Run it. If you already installed it, please run it first!
Then you can see whether the docker engine is starting or not! After the docker engine started check whether this error is still there. Most probably error will fix after doing that!
If the docker engine is not started, please uninstall docker and delete everything from Registry.
Press Win R and %appdata%\Docker
to go and delete all the files.
Then reinstall the docker, if better you can install the docker desktop. Because with the docker desktop, the docker provides a whole bundle with it! Then you will be able to install the docker for windows smoothly.
Because this error usually getting when the docker engine is not started. Also, this may happen missing Linux kernel on windows. Both issues will address with the correct installation of the Docker Desktop.
You can check whether you have a docker Linux subsystem running on your windows pc by running the following command on cmd,
wsl -l
If you get a result like this,
C:\Users\gayan>wsl -l
Windows Subsystem for Linux Distributions:
docker-desktop-data (Default)
docker-desktop
Then you are okay and ready to go.
If not, please try to uninstall and install the docker desktop
Make sure you delete the previous registry, To do that press Win R and type Regedit
Then go to HKEY_LOCAL_MACHINE -> SOFTWARE -> Docker Inc
and delete that folder.
If still you are getting the same error, try to troubleshoot the docker desktop. you can refer to the docker documentation.