Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

How to Install the latest version of Docker Compose on Alpine Linux(in 2022)

1 min read

Docker Compose V2 is the latest Compose version that went GA early this year during April 26, 2022. Compose V2 is the standard across all documentation, and Compose V2 will become the developer default on Docker Desktop. However, you can continue aliasing docker-compose to docker compose and opt-out of V2 via the Docker Desktop UI — or by entering the docker-compose disable-v2 command.

What if I use Linux?

Docker Desktop for Linux is now in beta and includes Compose V2. Alternatively, you can manually install Docker Compose V2 for Linux. In Moby v20.10.13, we’ve included compose-plugin as an optional Docker CLI plugin for easier installation. Check out our documentation for more information.

Compose V2 offers all of Compose V1’s functionality to help you efficiently run your multi-container applications. The transition to Go was one of our most liked roadmap items and has enabled us to deliver more features at a faster rate. These are now integrated into the Docker CLI, creating a seamless user experience across Docker’s tools. Read more about key features introduced in V2.

Step 1. Open the APK repository configuration file:

vi /etc/apk/repositories

Step 2. Add the following two lines:

#/media/cdrom/apks
http://ftp.halifax.rwth-aachen.de/alpine/v3.16/main
http://ftp.halifax.rwth-aachen.de/alpine/v3.16/community

Step 3. Update the Repo

apk update

Step 4. Install Docker and Docker Compose

apk add docker docker-cli-compose

Step 5. Verify the Docker and Docker Compose version

$ docker version
Client:
 Version:           20.10.17
 API version:       1.41
 Go version:        go1.17.11
 Git commit:        100c701
 Built:             Mon Jun  6 22:56:42 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.17
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.11
  Git commit:       a89b842
  Built:            Mon Jun  6 23:01:45 2022
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.6.6
  GitCommit:        10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc:
  Version:          1.1.2
  GitCommit:        v1.1.2-0-ga916309f
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Step 6: Verify Docker Compose Version

$ docker compose version
Docker Compose version v2.6.1

Getting Help

Have a question about Docker Compose? Search the Docker Forum Docker Compose tag for answers, or post a question in our Docker Community Forum.

Please follow and like us:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.