DEV Community

Brisbane Web Developer
Brisbane Web Developer

Posted on

How to install docker-compose 2 for Debian bookworm

Summary

I cannot install docker-compose-v2 via apt command for Debian bookworm.

Solution

Create the package by myself and install it by using some tools.

Steps

Install update-golang

mkdir -p /usr/local/src/github.com/udhos/update-golang
cd /usr/local/src/github.com/udhos/update-golang
git clone https://github.com/udhos/update-golang .

# Run with non-root user with "sudo"
# - Error happens otherwise
# - Latest version of Go for Debian bookworm was 1.19,
#   but the further steps required Go 1.22.1(?)
#   so that I installed the latest version
RELEASE=1.22.2 sudo ./update-golang.sh
Enter fullscreen mode Exit fullscreen mode

Install "makdeb" command

bash -ci "$(wget -qO - 'https://shlink.makedeb.org/install')"
Enter fullscreen mode Exit fullscreen mode

Create the package docker-compose_2 and install it

mkdir /usr/local/src/mpr.makedeb.org/docker-compose
cd /usr/local/src/mpr.makedeb.org/docker-compose
git clone https://mpr.makedeb.org/docker-compose .
Enter fullscreen mode Exit fullscreen mode

When I was doing this, it tried to install Go 1.19 and its decencies so that I disabled the line:

PKGBUILD
======
# makedepends=('golang-go>=1.17')
Enter fullscreen mode Exit fullscreen mode

and I installed only the decencies:

sudo apt install libpkgconf3 pkg-config pkgconf pkgconf-bin
Enter fullscreen mode Exit fullscreen mode

and then created the package:

makedeb -si
Enter fullscreen mode Exit fullscreen mode

and then installed the package:

sudo dpkg -i docker-compose_2.26.1-1_amd64.deb
Enter fullscreen mode Exit fullscreen mode

and then confirm if it is installed by running docker compose instead of docker-compose:

$ docker compose version
Docker Compose version v2.26.1
Enter fullscreen mode Exit fullscreen mode

Reference

Top comments (0)