Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"docker: 'compose' is not a docker command" under windows 10 but docker cli is working

I installed docker desktop version 4.18.0 and everything works perfectly except

docker-compose

However, when I have to launch a container with a docker-compose.yml file the "docker-compose" command is not recognized as you can see on the image below:

enter image description here

I specify that I looked carefully if the path of Docker and docker-compose was informed in the path in environment variable and it is indeed the case.

I looked at where the files were and I don't have any duplicates:

C:\Users\ZT PC USER>where docker
C:\Program Files\Docker\Docker\resources\bin\docker
C:\Program Files\Docker\Docker\resources\bin\docker.exe

C:\Users\ZT PC USER>where docker-compose
C:\Program Files\Docker\Docker\resources\bin\docker-compose
C:\Program Files\Docker\Docker\resources\bin\docker-compose.exe

At the configuration level, it is Windows 10 professional with WSL 2 activated and virtualization at the bios level activated.

The docker doc says to install via docker desktop, which I did several times but nothing happens.

In docker desktop Settings, "Use docker Compose V2" is still enable.

Thanks for the leads, I'm blocking!

I tried to reboot my machine several times, to reinstall docker too, to level up docker in the path...

like image 963
Paul Demarest Avatar asked Sep 18 '25 08:09

Paul Demarest


2 Answers

I was facing the same issue. Struggled with it for long time on my windows system. But when I upgraded my docker desktop to v4.25.2 it helped. I reopened the powershell terminal and when I executed the command docker-compose up it started working. Hope this helps!

like image 174
pkat121 Avatar answered Sep 23 '25 07:09

pkat121


I was having the exact same problem. It turns out windows was not being able to interprete the "docker-compose.exe" properly (hyphen might be interpreted as a command-line argument indicator rather than part of the filename itself), so when I run "docker-compose --version" it outputed docker version instead of the docker-compose version.

Try going to the directory where Docker is installed on your Windows system and renaming "docker-compose.exe" to "compose.exe" and then run "docker-compose" commands as "compose". It should work!

like image 36
Pedro Nuno Avatar answered Sep 23 '25 05:09

Pedro Nuno