Docker commands do not work (on Windows)

I try to use Docker on a Windows computer and get into any possible problem. My last one: My machine is working, but I canโ€™t interact with it using docker commands. If I run a very standard command, for example:

docker ps 

I get an error message:

 An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v 1.23/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. 

Thus, apparently, some way everything went bad. Does anyone know which way this is and how to fix it?

+64
docker
May 30 '16 at 14:16
source share
27 answers

When starting docker ps and getting:

An error occurred while trying to connect: Get http: //%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/json : open //./ pipe / docker_engine: the system cannot find the specified file.

You must set the following environment properties:

  set DOCKER_CERT_PATH=%USERPROFILE%\.docker\machine\machines\default set DOCKER_HOST=tcp://192.168.99.100:2376 set DOCKER_MACHINE_NAME=default set DOCKER_TLS_VERIFY=1 

It is assumed that the path %USERPROFILE%\.docker\machine\machines\default is the %USERPROFILE%\.docker\machine\machines\default path where the cert.pem files cert.pem , key.pem , ca-key.pem and ca.pem ; the name of the virtual machine (created by docker-machine create ) is default and the bottom border of the virtual server of the DHCP server (found in VirtualBox-> File-> Preferences-> Network-> Host-only Networks-> hover over VirtualBox Host-Only Ethernet adapter) is 192.168.99.100, and no other virtual machine works in VirtualBox.

+58
Sep 06 '16 at 13:52
source share

I ran into this problem when using a docking machine, and I did not run the docker-machine env after rebooting. I'm not sure how to do this in cmd.exe, but if you are using powershell, try this command:

 docker-machine env --shell=powershell | Invoke-Expression 
+17
Jun 01 '16 at 19:51
source share

The same problem here in Win 7. Solution:

In the Docker Quick Launch window, on the $ prompt line, run the following line:

your_user @your_machine MINGW64 ~

$ eval $ ("C: \ Program Files \ Docker Toolbox \ docker-machine.exe" env by default)

Then you can run docker run hello-world.

+17
11 Oct '16 at 22:34
source share

Verify that Hyper-V is up and running:

  • open extended command line
  • type bcdedit /set hypervisorlaunchtype auto
  • reboot
  • run "Docker for Windows"
+9
Aug 17 '16 at 11:19
source share
  • Open cmd with administrator privileges.
  • Run the following command

    docker-machine env --shell cmd by default

  • you will get the following output

    SET DOCKER_TLS_VERIFY = 1

    SET DOCKER_HOST = tcp: //192.168.99.102: 2376

    SET DOCKER_CERT_PATH = C: \ Users \ DBashyal.docker \ machine \ machines \ default

    SET DOCKER_MACHINE_NAME = default

    REM Run this command to configure the shell:

    REM @ FOR / f "tokens = *"% i IN ('docker-machine env --shell cmd default') DO @% i

  • Copy the highlighted line and execute on cmd

    @ FOR / f "tokens = *"% i IN ('docker-machine env --shell cmd default') DO @% i

  • Run the following command

    docker ps

+6
Jun 01 '17 at 3:26
source share

I created a new machine using the following command

 docker-machine create --driver=virtualbox vbox-test 

Then the command is executed

 docker-machine env --shell=powershell | Invoke-Expression 

Got a job ...

+5
Jan 24 '17 at 4:36 on
source share

I had to deal with the same problem on Windows.

To solve this problem:

  • Create a docker machine (only if you donโ€™t have one)

     docker-machine create default 
  • Get ENV files that need a client docker to connect to the docker machine (server) [This needs to be done every time or installed in your ENV-vars]

     docker-machine.exe env default 

    You can install them manually or do one of the following depending on your shell environment ( cmd , bash , power-shell )

     docker-machine env --shell=cmd # you need to run it manually docker-machine env --shell=bash > env-var-commands-tmp && . env-var-commands-tmp && rm env-var-commands-tmp docker-machine env --shell=powershell | Invoke-Expression 
+5
May 21 '17 at 12:17
source share

I looked through all the above answers and none of them worked. Then I found out that the command should be executed on the linux command line, for example bash. so try:

Enter the command in the Docker bash VM terminal, which comes with the docker toolbar, unlike cmd windows

If you are already convinced that your docker is running

+3
Oct 17 '16 at 15:54
source share

As indicated in other answers, you need to set several environment variables.

The easiest way to do this:

  @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd') DO @%i 

This will launch docker-machine env --shell cmd and add these environment variables.

If you want these variables to be constant, they defined them in windows ( tutorial ).

+3
Feb 05 '17 at 21:25
source share

Right-click the docker icon in the tray and select Switch to Windows Containers .... You may be prompted to enable the Containers feature. Do this and reboot again.

+2
Nov 09 '17 at 20:10
source share

In my case, the docker service did not start after reboot, so I just started

+1
Dec 16 '16 at 11:45
source share

I had a similar problem when I installed Docker CE for Windows Version 17.11.0-ce-rc4-win39 (14244) Channel: edge e557194 on Windows 10.

In command / cmd windows, when I tried to run the docker ps, docker version, docker info commands, I had an error, for example, "error during connection: Get http: //%2F%2F.%2Fpipe%2Fdocker_engine/v1. 34 / version "every time.

To solve this problem,

  • I made "Hyper-V" turned off (unchecked) with "Enable or disable the Windows feature", for which you need to restart the OS.
  • And after the first restart, I did "Hyper-V" On (Checked), which again required a reboot of the OS.

After the second restart, the docker teams started work and gave the correct exit.

So, turning Hyper-V off and then on resolved this issue for me.

+1
Nov 21 '17 at 14:02
source share

I got a solution from this problem . This is not the case as Nikeshโ€™s answer says SwitchDaemon can fix this directly. I think you should run this command twice to switch your daemon to your previous daemon.

 cd "C:\Program Files\Docker\Docker" ./DockerCli.exe -SwitchDaemon # then check the docker OS/Arch docker version # You may see the different OS/Arch ./DockerCli.exe -SwitchDaemon # then you got your images and containers back 

This command simply switches your daemon from your defualt daemon to another daemon (depending on what you installed). When you switch to another daemon, the images and containers on the previous daemon disappear (but are not lost).

+1
May 08 '19 at 3:28
source share

To start the default host on Windows, I know three ways below, you can use one of them.

  1. Starting or restarting an already created machine by default using Docker:

     docker-machine start default docker-machine restart default 

    Now check docker-machine env

  2. The following environment properties must be set:

     set DOCKER_CERT_PATH=%USERPROFILE%\.docker\machine\machines\default set DOCKER_HOST=tcp://192.168.99.100:2376 set DOCKER_MACHINE_NAME=default set DOCKER_TLS_VERIFY=1 
  3. To create a new computer, use the following command:

Windows 10 / HyperV:

 docker-machine create --driver hyperv default docker-machine create -d hyperv default 

Mac, Linux, Windows 7 and 8:

 docker-machine create --driver virtualbox default docker-machine create -d virtualbox default 
+1
May 23 '19 at 19:09
source share

I had this problem on a Windows 2016 machine. It so happened that the docker service was not running. In my case, the docker service as an error with the following error

fatal: daemon startup error: pid file found, make sure docker is not running or not deleted C: \ ProgramData \ docker.pid

Deleting the file C: \ ProgramData \ docker.pid did the trick.

0
Oct. 14 '16 at 10:24
source share

In the tray, Docker is running, but in Docker-> Settings the status is: Cannot start. Docker reboot failed.

0
Dec 25 '16 at 9:22
source share

below is allowed. I copied the answer from another forum

I had this problem after updating. After reinstalling VB, I turned on the "VirtualBox NDIS6 Bridged Networking Driver" in the network connection properties.

In my case, the property is disabled by default. `

0
Apr 02 '17 at 18:33
source share

Windows 10 Professional For me, the Docker service was started, but Docker still needed to be "started." That is, I had the option "Launch Docker at login" not checked in the Docker tray icon.

Before finding this, I went to the Docker program folder and clicked "Docker for Windows". After a short while, the message "Docker is running" is displayed.

0
Jun 15 '17 at 22:55
source share

For me, this error was resolved after deleting the daemon.json file in "%programdata%\docker\config"

The contents of my daemon.json follows:

 { "hosts": ["tcp://0.0.0.0:2375"] } 

I created this manually as part of some testing. But after rebooting the server, I started getting an error in this question.

0
Sep 27 '17 at 7:58
source share

The error really bothers. I hope the developers of Docker do something. It took a lot of attempts and mistakes. Thanks to Stackoverflow and other blogs. In my case, I am using Windows 10 Pro. I installed with DockerToolbox.exe after several unsuccessful attempts with Docker for Windows Installer.exe. Then I came across An error occurred trying to connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v . These steps were followed and the problem was resolved. First, I went to Control Panel -> Turn Windows Features On or Off and Disable Hyper-V
enter image description here Next, Open PowerShell as an administrator:

 docker-machine env --shell=powershell | Invoke-Expression type bcdedit /set hypervisorlaunchtype auto 

Rebooting my system. Then I launched the "Docker Quickstart Terminal", then I entered this into the shell window.

 run "Docker for Windows" docker run hello-world 

Everything worked out for me. Then open command prompt

 docker run hello-world 

He gave an error: Then I entered

 set DOCKER_CERT_PATH=%USERPROFILE%\.docker\machine\machines\default set DOCKER_HOST=tcp://192.168.99.100:2376 set DOCKER_MACHINE_NAME=default set DOCKER_TLS_VERIFY=1 

Most of the suggestions above are also helpful.

0
Oct 10 '17 at 2:31 on
source share

I saw this error message after the weekend. My setup was fine before that. My config and connections looked right. $docker-machine restart default fixed this for me on Windows 7

0
Feb 12 '18 at 19:23
source share

I was getting this error when running docker-compose up . The problem for me was that the Docker service was not working. So I had to start services.msc and start the Docker service.

enter image description here

0
Jun 12 '18 at 13:21
source share

I solved this error by running {DOCKER_TOOLBOX_INSTALL_PATH}start.sh in bash.

0
Sep 05 '18 at 9:50
source share

In my case, all of the above solutions have not been decided. Instead of zilurran, the answer helped.

  cd "C:\Program Files\Docker\Docker" ./DockerCli.exe -SwitchDaemon 
0
Jan 30 '19 at 8:04
source share
  1. Switch to Windows containers
  2. docker information
  3. docker PS
  4. Go back to Linux containers
  5. docker information
  6. Viola!

The Windows switch probably launches the missing configurations that Linux also needs.

0
Mar 15 '19 at 6:52
source share

I had a similar problem. For me, I did not enter docker from the status bar. What I did to enter the docker from the status bar. After I logged in, I was able to correctly execute all the commands. Try logging in using your docker id and password, maybe this will solve your problem.

0
Jun 25 '19 at 4:53 on
source share

I had the same problem on my Windows 10. Find below what I did to solve it:

After installing Docker, just restart your computer, launch the docker application (you may need to enable Hyper-V), then open a command prompt and type: docker run hello-world

Everything works fine :)

-one
Jul 28 '17 at 15:34
source share



All Articles