Windows doesn't recognize Docker command
DockerDocker Problem Overview
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.
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
byecho %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]
Step:2 [Paste the docker location] In my case C:\Program Files\Docker Toolbox.
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"
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.
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.
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.
Then I tried with fresh terminal of Command Prompt -- it worked!
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
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
- Download "docker-machine-Windows-x86_64.exe" from: https://github.com/docker/machine/releases
- Rename "docker-machine-Windows-x86_64.exe" to "docker-machine.exe".
- Copy "docker-machine.exe" to path
C:\Program Files\Docker\Docker\resources\bin
.
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.