Docker Compose Installation

Define and run multi-container applications with Docker

Install Compose V1

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version

Uninstall Compose V1

sudo rm /usr/local/bin/docker-compose

Install Compose V2

sudo mkdir -p ~/.docker/cli-plugins/
sudo curl -SL -o ~/.docker/cli-plugins/docker-compose
sudo chmod +x ~/.docker/cli-plugins/docker-compose
sudo cp ~/.docker/cli-plugins/docker-compose /usr/local/bin/
docker compose version

Uninstall Compose V2

sudo rm ~/.docker/cli-plugins/docker-compose

Compose Switch

Compose Switch is a replacement to the Compose V1 docker-compose (python) executable. Compose switch translates the command line into Compose V2 docker compose and then runs the latter.