Flik
Flik

Reputation: 425

"docker: 'compose' is not a docker command" when running docker compose

After installing the latest version of Docker Desktop on my M1 Mac pro, I can't seem to run docker compose despite having all the correct files installed.

I've tried running docker-compose and docker compose in my terminal and I get this message: docker: 'compose' is not a docker command.

After running docker --version, I'm currently on Docker version 20.10.21, build baeda1f

Compose is correctly added to my PATH vars under /usr/local/bin/, which has the following files:

com.docker.cli          docker-credential-desktop       fuzzy_match         kubectl.docker
docker                  docker-credential-ecr-login     httpclient          vpnkit
docker-compose          docker-credential-osxkeychain   hub-tool            xcodeproj
docker-compose-v1       docker-index                    kubectl

When I run which docker-compose, it returns /usr/local/bin/docker-compose so it seems like everything is configured correctly.

Also running docker-compose-v1 does seem to work for some weird reason.

Any ideas?

Edit: Seems like this was fixed after installing the newest version of Docker (Docker Desktop 4.14.1 (91661), Docker version 20.10.21, build baeda1f).

Upvotes: 12

Views: 22183

Answers (3)

Atul Tripathi
Atul Tripathi

Reputation: 13

I fixed this on windows by opening docker desktop manually and after it started, I could see the terminal recognizing the docker compose command.

Upvotes: 0

Matthias
Matthias

Reputation: 707

I encountered this issue because I had not yet set up docker desktop. After opening the Docker Desktop app and allowing it to complete the install process, docker-compose worked as expected.

Upvotes: 0

Rod Pereira
Rod Pereira

Reputation: 76

Install Rosetta 2 with softwareupdate --install-rosetta, then uncheck Use Docker Compose V2 in Docker Dashboard -> Settings -> General.

Upvotes: 6

Related Questions