Introduction
This article is focusing on how to solve an error message appear on executing a docker command. The execution of this docker command occur in Microsoft Windows operating system. The following is the execution of it :
C:\mydocker-build>docker build --tag hello-world:latest . error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect.: 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&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=hello-world%3Alatest&target=&ulimits=null&version=1": open //./pipe/docker_engine: The system cannot find the file specified. C:\mydocker-build>
Actually, there is a little bit of additional condition appears. The following are those conditions :
-
It is when the PC or the laptop running using Microsoft Windows operating system is going for a shut down before.
-
But the shut down process fail and it stay in a screensaver locked mode.
-
After logging back to the PC or laptop, execute the above command.
-
But the result of the execution ends in a failure.
Solution
So, how to solve it ?. The answer is very easy. Just start the docker service once more. Make sure that the docker service is running. The following are the steps to do it :
-
Just type ‘docker’ in the search field as in the following image :
Just click and run the Docker Desktop application as exist in the above image of the result search.
-
The following Docker Desktop application will appear :
-
If the above Docker Desktop app is running, try to execute the docker command once more. If there are no error message, the process for building docker image will run normally as it exist below :
C:\mydocker-build>docker build --tag hello-world:latest . [+] Building 8.7s (5/5) FINISHED => [internal] load build definition from Dockerfile 0.1s => => transferring dockerfile: 313B 0.0s => [internal] load .dockerignore 0.1s => => transferring context: 2B 0.0s => [internal] load metadata for 127.0.0.1:5000/centos:latest 0.7s => [1/1] FROM 127.0.0.1:5000/centos@sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc 7.8s => => resolve 127.0.0.1:5000/centos@sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc 0.0s => => sha256:a1801b843b1bfaf77c501e7a6d3f709401a1e0c83863037fa3aab063a7fdb9dc 529B / 529B 0.0s => => sha256:5d0da3dc976460b72c77d94c8a1ad043720b0416bfc16c52c45d4847e53fadb6 2.14kB / 2.14kB 0.0s => => sha256:a1d0c75327776413fa0db9ed3adcdbadedc95a662eb1d360dad82bb913f8a1d1 83.52MB / 83.52MB 1.9s => => extracting sha256:a1d0c75327776413fa0db9ed3adcdbadedc95a662eb1d360dad82bb913f8a1d1 5.5s => exporting to image 0.0s => => exporting layers 0.0s => => writing image sha256:22773018c04267669821153cd42ef21101902b10a8a16f340fbef85a77821d03 0.0s => => naming to docker.io/library/hello-world:latest 0.0s Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them C:\mydocker-build>
One thought on “How to Solve Error Message error during connect: In the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect when running Docker command”