45

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 ?

Ashwani Panwar
  • 3,819
  • 3
  • 46
  • 66
  • 3
    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. See if it solves the problem. – 7_R3X Aug 12 '19 at 11:38

7 Answers7

73

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.

RDavey
  • 1,530
  • 10
  • 27
6

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.

David Buck
  • 3,752
  • 35
  • 31
  • 35
3

I had a similar issue : Docker Desktop was configured to run Linux containers but my Visual Studio project targeted Windows containers.

So after launching Docker, I right-clicked the whale (was red) in the taskbar's tray and selected the 'Switch to Windows containers' menu item.

An error message showed up talking about 'Deny write access for fixed drives not protected by Bitlocker' which was fixed by launching a regedit and putting a 0 for the following key : Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE\FDVDenyWriteAccess

Then repeating the tray action finally worked and the whale turned to white.

leguminator
  • 164
  • 1
  • 8
3

Open PowerShell as Administrator and run:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Ryan M
  • 18,333
  • 31
  • 67
  • 74
1

try this on your CMD:

docker-machine create box
docker-machine env box

this issue still open

LinPy
  • 16,987
  • 4
  • 43
  • 57
0

What solved in my case, on Windows 11, was to turn off Hypervisor and Windows Subsystem for Linux, reboot and turn on again.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
0
  1. Start the Docker service
  2. In the command line do the following:
    net stop com.docker.service
    
  3. Then:
    net start com.docker.service
    
user16217248
  • 3,119
  • 19
  • 19
  • 37