Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The docker client must be run elevated to connect

Tags:

docker

When I am trying to built docker app, I am getting below error. Command I am running is docker build -t node_curd_exe .

error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/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&session=h3q9gxeprezyco28agiqe9jp2&shmsize=0&t=node_curd_exe&target=&ulimits=null&version=1: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

Anything else I can do ?

like image 599
Ashwani Panwar Avatar asked Aug 12 '19 11:08

Ashwani Panwar


People also ask

How do I run Docker client with elevated privileges?

Go to the directory where the Docker is installed on your Windows installation drive and find a file named "Docker for Windows.exe", right click it and run it as administrator.

How do I run Docker with elevated privileges in Windows 10?

Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.

How do I connect to a Docker container?

To connect to a container using plain docker commands, you can use docker exec and docker attach . docker exec is a lot more popular because you can run a new command that allows you to spawn a new shell. You can check processes, files and operate like in your local environment.


2 Answers

I have encountered this problem myself. My problem was that I had configured Docker Desktop to not run at startup. As long as Docker Desktop is not running, you will not have the Docker daemon running, hence the error.

Quickly check whether you have a white whale in your taskbar before trying any more exotic solutions.

like image 125
RDavey Avatar answered Oct 06 '22 00:10

RDavey


Try this:

"Hardware assisted virtualization and data execution protection must be enabled in the BIOS" Typically, this problem is due to a disabled Hyper-V or because the hypervisor agent is not running. Open a Windows shell as administrator and enable Hyper-V with:

dism /Online /Enable-Feature:Microsoft-Hyper-V /All

Reboot your machine and see if Docker for Windows starts. If the above doesn't work, open a Windows shell as administrator and enable the hypervisor with:

bcdedit /set hypervisorlaunchtype auto

If Docker for Windows is still not working properly, try the following additional solutions, which are based on instructions extracted from this Docker for Windows issue thread.

Reboot your machine and see if Docker for Windows starts. Copy this path: Control Panel\Programs\Programs and Features into a File Explorer address bar.

Click Turn Windows feature on or off on the left side of the Control Panel. Clear the Hyper-V check box in the list of Windows features.

Reboot your machine and start Docker for Windows (or reinstall if necessary). If the above doesn't work, then Virtualization Based Security (VBS) might be interfering and needs to be disabled. Try the following to disable VBS: Open the Local Group Policy Editor (gpedit.msc)

Go to Computer Configuration\Administrative Templates\System\Device Guard Disable VBS.

like image 37
VishalCodingNinja Avatar answered Oct 06 '22 00:10

VishalCodingNinja