Docker Compose Installation

Define and run multi-container applications with Docker

Install Compose V1

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(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 https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -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.