Reputation: 4270
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.
Did I miss something ?
Upvotes: 90
Views: 284663
Reputation: 1
*just add in your environmental Path this syntax if you did like (install docker in c drive) me, most probably it would work, for me, this passed well.
(note: if you going to call RefreshEnv.cmd
or RefreshEnv
through your CMC with Chocolatey, this path would not be created for you, and you have to do it manualy in Windows 10 operating system).
C:\Program Files\Docker\Docker\resources\bin
Upvotes: 0
Reputation: 257
2022 - Windows 11
Add these paths to the PATH variable.
C:\Program Files\Docker\Docker\resources\bin
C:\ProgramData\DockerDesktop\version-bin
Docker PATH variable Windows 11:
Upvotes: 8
Reputation: 43
just add this path in your "Path" inside env variables inside windows
C:\Program Files\Docker\Docker\resources\bin
then restart your gitbash or cmd or ...
everything goes well after that !
Upvotes: 1
Reputation: 123
I facing the same issue when I try to run docker -v
in Vscode Terminal after install it. I try to use cmd and git bash it work fine. Restart your vscode will solve it
Upvotes: 2
Reputation: 195
In my case, I switched to the windows command prompt instead of the VScode terminal.
Upvotes: 0
Reputation: 719
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
Upvotes: 3
Reputation: 11
C:\Program Files\Docker\Docker\resources\bin
.Upvotes: 0
Reputation: 11932
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.
Upvotes: 1
Reputation: 41
I faced the same problem, them I tried in Powershell which works someHo
Upvotes: 0
Reputation: 642
Unfortunately, After many tries and restarts, I uninstalled docker and Re-installed it again, and I had to build all things again.
Upvotes: 0
Reputation: 91
Renaming 'com.docker.cli' to 'docker' helped me finally get windows powershell and cmd terminals to recognize the docker command.
Upvotes: 9
Reputation: 1294
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
Upvotes: 9
Reputation: 154
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
Upvotes: 12
Reputation: 25349
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.
Upvotes: 1
Reputation: 253
Just Restart the system, it is always good practice to restart the system when you install or uninstall any application. Hope this works :)
Upvotes: 2
Reputation: 11
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
Upvotes: 1
Reputation: 302
If you have installed Docker Toolbox in your windows, go and add the environment variable.
PATH = "location of folder that contains docker-machine"
Upvotes: 1
Reputation: 11
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.
Upvotes: 1
Reputation: 101
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"
Upvotes: 2
Reputation: 893
You need to restart the system after installation. It worked for me.
Upvotes: 1
Reputation: 4387
Run as administrator worked for me, both powershell and bash on windows. I did not need to restart.
Upvotes: 4
Reputation: 81
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.
Upvotes: 5
Reputation: 4759
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.
Upvotes: 97
Reputation: 67
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
PATH
by echo %PATH%
before doing thisFor permanent change setx PATH=%PATH%;C:\Program Files\Docker Toolbox
Upvotes: 7
Reputation: 1665
You need to start the docker first if you have not and then open powershell.
In the powershell, try to run docker commands.
Upvotes: 18
Reputation: 4270
I restarted the system, it worked, maybe we can say that a restart is required.
Upvotes: 74