Reputation: 28841
I have recently installed Docker Toolbox on my Windows 10 machine.
However, whenever I run docker-compose up
I get the following error message:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose\cli\main.py", line 65, in main
File "compose\cli\main.py", line 117, in perform_command
File "compose\cli\main.py", line 849, in up
File "compose\project.py", line 372, in up
File "compose\project.py", line 539, in warn_for_swarm_mode
File "site-packages\docker\api\daemon.py", line 33, in info
File "site-packages\docker\utils\decorators.py", line 47, in inner
File "site-packages\docker\client.py", line 139, in _get
File "site-packages\requests\sessions.py", line 488, in get
File "site-packages\requests\sessions.py", line 475, in request
File "site-packages\requests\sessions.py", line 596, in send
File "site-packages\requests\adapters.py", line 423, in send
File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
File "httplib.py", line 1057, in request
File "httplib.py", line 1097, in _send_request
File "httplib.py", line 1053, in endheaders
File "httplib.py", line 897, in _send_output
File "httplib.py", line 859, in send
File "site-packages\docker\transport\npipeconn.py", line 31, in connect
File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
File "site-packages\docker\transport\npipesocket.py", line 49, in connect
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')
docker-compose returned -1
Note that I have C:\Python27
and C:\Python27\Scripts
in both my user and system environment variables. I also tried this using Python 3, and it still doesn't work.
Upvotes: 119
Views: 113239
Reputation: 39
There is another chance Why this error occurring
Go to docker Dashboard settings > General
and check use Docker compose v2 is checked or not. if it is not Please ✓ it. Then try again it will work
Upvotes: 1
Reputation: 360
I bumped into this issue after I executed wsl --shutdown
.
However, Docker Desktop still shows that it is running in the tray, but it does not show any containers which I did not delete.
Just had to make sure Docker Desktop is exited completely and relaunch it back again.
Upvotes: 0
Reputation: 358
Had same issue on Windows 10 after installing Docker using Docker Desktop Installer and left out the last installation for "WSL2 Linux kernel update package for x64 machines". After installing that and restart the laptop it was fine.
Upvotes: 0
Reputation: 483
You might be missing the inverted commas somewhere on the docker-compose.yml file Eg. Change volumes:
Upvotes: 2
Reputation: 653
I had the same problem.
Starting the docker daemon resolved the issue. Just search for docker pressing windows key and click on "Docker Dekstop". Daemon should be running in a minute.
Upvotes: 7
Reputation: 437
Same error will be caused if docker for windows was installed and activated, but never logged in..
Upvotes: 1
Reputation: 23873
Had this issue on Windows after restarting Docker Desktop.
The solution was to close my terminal window and open a fresh one.
Upvotes: 1
Reputation: 57872
I had this issue today, here's what fixed it for me on Windows.
If everything is working correctly, the box will remain checked after you click "reset credentials". If it's not, resetting your credentials will cause the box to become unchecked and you'll have to Reset Docker to Factory defaults again.
Upvotes: 1
Reputation: 1917
Run docker-compose
with the Docker Quickstart Terminal. It will solve your error.
The Docker Quickstart Terminal is mostly a regular shell but allows to create a default machine. It can be used to connect to other machines as well:
eval $(docker-machine env <MACHINE_NAME>)
Upvotes: 18
Reputation: 720
In Docker Quickstart Terminal I ran docker-machine env
, and it gave me:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="C:\Users\TheGeniesis\.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
export COMPOSE_CONVERT_WINDOWS_PATHS="true"
#### Run this command to configure your shell:
eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
I ran eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
. That's it!
This solution was copied from this issue. I'm on a Windows 10 Home. This solved my problem.
Upvotes: 3
Reputation: 652
I have used Docker Toolbox since I am on Windows 8.1. After many hours of troubleshooting I solved this issue by:
Upvotes: 1
Reputation: 347
I had this problem with a fresh install of Docker on Windows 10. My issue was that I hadn't actually run Docker first; I just installed the .msi and ran "docker-compose" from the command line.
Once I ran Docker, (and followed a few more post-installation steps, to include logging out of and restarting my computer) I was able to run docker-compose
without issue.
Upvotes: 8
Reputation: 1365
You can set properties by typing the following commands:
docker-machine env --shell cmd default
@FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO @%i
Upvotes: 6
Reputation: 809
You and I may or may not have the same problem. In the link posted by @Haken Lid above, the issue is with the PATH environment variable not having the correct version of Python.
BUT, for me, the issue was that I had not set all of my environment variables, by running
eval $(docker-machine env <vmname>)
before I ran the docker-compose <any command>
.
Upvotes: 24
Reputation: 3490
Make sure Docker for Windows is up and running in the system tray. That was my problem.
Upvotes: 22
Reputation: 4282
I just forgot to start "Docker for Windows" which resulted in that error.
Upvotes: 332
Reputation: 186
I ran into this issue after the Docker Quickstart Terminal hanged a while on "Waiting for an IP..." during start up.
Restarting the Docker Quickstart Terminal fixed everything.
Upvotes: 1
Reputation: 17466
I spent close to an hour fixing this issue on my Windows machine.
Settings...
. Go to Shared Drives
and select C:
drive. You will be prompted for credentials. [*]docker build .
Run docker-compose up
.
[*]: If you don't do this step you might see this error when on step 6: ERROR: for website Cannot create container for service website: C: drive is not shared. Please share it in Docker for Windows Settings
. If after entering your credentials the C: drive isn't checked, create a new user for your machine that has full access to the folder where you will run docker-compose up
.
Upvotes: 5