Windows doesn't recognize Docker command

Docker

Docker Problem Overview


I already installed Docker for windows. when I type docker --version command in Command prompt, it doesn't recognize it at all.

The message will be this:

'docker' is not recognized as an internal or external command,
operable program or batch file.

docker --version command in cmd

Did I miss something ?

Docker Solutions


Solution 1 - Docker

I had installed Docker 18.06.1-ce version on my Windows 10 machine and faced the similar issue, even though the docker was added the Windows %PATH%.

I moved the docker path to the bottom and that solved my problem.

enter image description here

enter image description here

Solution 2 - Docker

I restarted the system, it worked, maybe we can say that a restart is required.

Solution 3 - Docker

You need to start the docker first if you have not and then open powershell.

In the powershell, try to run docker commands.

Solution 4 - Docker

I installed docker Docker version 19.03.13 build 4484c46d9d, in Windows 10 pro 1903. I was facing the same issue, then I just renamed 'com.docker.cli' to 'docker' and set the environment variable to 'C:\Program Files\Docker\Docker\resources\bin'

Problem Resolved.

Refer the image:

https://drive.google.com/file/d/1sZwx4udOzJeITV2RDGQKlsOt_TF4Wq2N/view?usp=sharing

https://drive.google.com/file/d/1DpW2DR2n_jCGezwrXuhNtXpSTBWmEDJk/view?usp=sharing

Solution 5 - Docker

Renaming 'com.docker.cli' to 'docker' helped me finally get windows powershell and cmd terminals to recognize the docker command.

Solution 6 - Docker

Add docker to PATH variable & refreshenv to keep using the same command prompt


If you've installed using docker toolbox the install path "C:\Program Files\Docker Toolbox"

Manually using Environmental Variable > Path (add docker path here)


Using Command Line

For temporary use set PATH=%PATH%;C:\Program Files\Docker Toolbox

  • Make sure to take a back up of PATH by echo %PATH% before doing this

For permanent change setx PATH=%PATH%;C:\Program Files\Docker Toolbox

Solution 7 - Docker

docker: command not found

Windows 7: Just set the path of docker in system variable

Step:1 [Click on path -> edit-> paste the docker location]

enter image description here

Step:2 [Paste the docker location] In my case C:\Program Files\Docker Toolbox.

enter image description here

now check $ docker version

Solution 8 - Docker

Make sure the docker.exe path (C:\Program Files\Docker\Docker\resources\bin) is added to the PATH variable.

You can check it as follows:

ECHO %PATH%

The docker path had to be appended at the end of the PATH in my case. After that docker cmd was recognized.

Solution 9 - Docker

Run as administrator worked for me, both powershell and bash on windows. I did not need to restart.

Solution 10 - Docker

Just Restart the system, it is always good practice to restart the system when you install or uninstall any application. Hope this works :)

Solution 11 - Docker

You need to restart the system after installation. It worked for me.

Solution 12 - Docker

I checked environment variables and noticed that docker path is as the following path in which "R" in resources uppercase. I fixed the case and everything worked as expected Path: "C:\Program Files\Docker\Docker\Resources\bin"

Solution 13 - Docker

Try to install GIT bash and then run this command on it for Windows:

base=https://github.com/docker/machine/releases/download/v0.16.0 &&
mkdir -p "$HOME/bin" &&
curl -L $base/docker-machine-Windows-x86_64.exe > "$HOME/bin/docker-machine.exe" &&
chmod +x "$HOME/bin/docker-machine.exe"

Click Here.

there is some issues with PowerShell or new version of docker due to which I was facing the same issue but then I went to this page and got way to run it.

> PS: GIT bash is required.

Solution 14 - Docker

If you have installed Docker Toolbox in your windows, go and add the environment variable.

PATH = "location of folder that contains docker-machine"

Solution 15 - Docker

I also face a problem with the installation and running docker. I'm not sure you how did you install docker. I tried this way. I've downloaded the docker toolbox (https://github.com/docker/toolbox/releases) which comes up with docker,docker-machine. Oracle Virtual box which is pretty much enough to start docker locally.Please make sure you have git bash installed in your local. Once the toolbox installation is done click the icon generated on the desktop . Make sure this icon target to your Git bash.exe (you can verify this by right click on icon and find target). and verify docker version

Solution 16 - Docker

For me, I had to ensure the check box Enable Hyper-V Windows Features is checked as I was installing.

I just wanted to have client installed, without the engine. So earlier, as I was installing, I unchecked that option. And after successful installation, I get the error - windows does not recognize docker.

But now that reinstalled with the checkbox checked, things are working fine now.

Enable Hyper-V Windows Features

Solution 17 - Docker

I've tried to play with paths but it didn't work. Then I found that it works for me only when I type docker-compose instead of docker. So docker-compose version or docker-compose images worked for me as well, as any other command.

Solution 18 - Docker

I noticed that running docker commands before startup causes this issue, but ensuring that docker is running and executing the commands after, they are then recognised. enter image description here

Solution 19 - Docker

For those who are facing docker issue on VS Code

I was trying on VS Code Terminal after installation. Restarted and was still facing issue.

enter image description here

Then I tried with fresh terminal of Command Prompt -- it worked!

enter image description here

After that it also working fine on vs code.

In VS Code - close all terminals and open fresh terminal and try test command:

docker --version

enter image description here

Solution 20 - Docker

Unfortunately, After many tries and restarts, I uninstalled docker and Re-installed it again, and I had to build all things again.

Solution 21 - Docker

I faced the same problem, them I tried in Powershell which works someHo

Solution 22 - Docker

  1. Download "docker-machine-Windows-x86_64.exe" from: https://github.com/docker/machine/releases
  2. Rename "docker-machine-Windows-x86_64.exe" to "docker-machine.exe".
  3. Copy "docker-machine.exe" to path C:\Program Files\Docker\Docker\resources\bin.

image

Solution 23 - Docker

For windows server

Use Install-windowsFeature Containers

Solution 24 - Docker

In my case, I switched to the windows command prompt instead of the VScode terminal.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMohammad HeydariView Question on Stackoverflow
Solution 1 - DockerRajeshView Answer on Stackoverflow
Solution 2 - DockerMohammad HeydariView Answer on Stackoverflow
Solution 3 - DockerArijit PandaView Answer on Stackoverflow
Solution 4 - DockerSandeep GoutamView Answer on Stackoverflow
Solution 5 - DockerEdwin OkoronkwoView Answer on Stackoverflow
Solution 6 - Dockermastercoder8View Answer on Stackoverflow
Solution 7 - DockerPrasenjit MahatoView Answer on Stackoverflow
Solution 8 - DockerRadhaView Answer on Stackoverflow
Solution 9 - DockerlearnerplatesView Answer on Stackoverflow
Solution 10 - Dockervinay k hegdeView Answer on Stackoverflow
Solution 11 - DockerSudheer MuhammedView Answer on Stackoverflow
Solution 12 - DockergurkanindibayView Answer on Stackoverflow
Solution 13 - Dockertushar mathurView Answer on Stackoverflow
Solution 14 - DockerAashman ThingView Answer on Stackoverflow
Solution 15 - DockerNaveenView Answer on Stackoverflow
Solution 16 - DockerVivekDevView Answer on Stackoverflow
Solution 17 - DockerPhilip HunkevychView Answer on Stackoverflow
Solution 18 - DockerFelix TooView Answer on Stackoverflow
Solution 19 - DockerdjsreerajView Answer on Stackoverflow
Solution 20 - DockerMahmoud NasrView Answer on Stackoverflow
Solution 21 - Dockertori_sanView Answer on Stackoverflow
Solution 22 - DockerJohto RobbieView Answer on Stackoverflow
Solution 23 - DockerSwapnilView Answer on Stackoverflow
Solution 24 - DockerGeoAfrikanaView Answer on Stackoverflow