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

Billboard image

Monitoring as code

With Checkly, you can use Playwright tests and Javascript to monitor end-to-end scenarios in your NextJS, Astro, Remix, or other application.

Get started now!

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay