Projekt

Allgemein

Profil

Aktionen

Setup docker compose v2

https://goneuland.de/docker-docker-compose-v2-auf-ubuntu-22-04-lts-installieren/

uninstall old version of docker

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

add docker-repo

remove olkt source-list

sudo rm /etc/apt/sources.list.d/docker.list

install dependencies

sudo apt update
sudo apt install ca-certificates curl gnupg

add keys

sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

add repo

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

docker and docker compose install

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

check version:

sudo docker --version && docker compose version

as of 2024-03-19

Docker version 25.0.4, build 1a576c5
Docker Compose version v2.24.7

cheat-sheet

sudo docker compose up -d
sudo docker compose logs
sudo docker compose  down
sudo docker ps
sudo docker exec -it b84444ac0cdb /bin/bash

or more generic ...

sudo docker compose -p pwd -f pwd.yml up -d
sudo docker compose -p pwd -f pwd.yml logs
sudo docker compose -p pwd -f pwd.yml down
sudo docker ps
sudo docker exec -it b84444ac0cdb /bin/bash

reset everything in the docker instance

sudo docker compose down
sudo docker rm -f $(sudo docker ps -a -q)
sudo docker volume rm $(sudo docker volume ls -q)
sudo docker compose up -d

Von Jeremias Keihsler vor 8 Monaten aktualisiert · 6 Revisionen