[Docker] After changing to a Mac with Apple Chip, I get ‘zsh: command not found: docker-compose’ and can’t use Docker commands anymore, so I have to fix it.


After changing my Mac from an Intel Chip to an Apple Chip PC, the Docker command is no longer recognised.
Check the version as follows.

% docker-compose --version
zsh: command not found: docker-compose

As it says ‘command not found’, docker-compose may not be installed.
Check the situation and make it usable.

目次

Check Docker Compose.

docker-compose has been moved from ‘Docker Compose V1’ to ‘Docker Compose V2’. docker-compose V2 is integrated into the Docker CLI and is used as docker compose. (The hyphen is missing from the string.)

To do so, run the following commands.

% docker compose version
Docker Compose version v2.29.7-desktop.

If this works, Docker Compose V2 is already installed.
In this case, using docker compose instead of docker-compose will solve the problem.

Install Docker Compose.

If docker compose is also not available, you need to install Docker.

Installing the latest version of Docker will automatically install Docker Compose V2.

  1. On the official Docker website, click Docker Desktop for Mac with Apple Sillicon.
  2. Click on the downloaded image file to install.

After installation, run the following command and if it works, it is OK.

% docker compose version
Docker Compose version v2.29.7-desktop.
よかったらシェアしてね!
目次