Docker

Remove all containers

1
2
docker container stop $(docker container ls -aq)
docker container rm $(docker container ls -aq)

Install sur fedora

On peut utiliser diretement les depots https://download.docker.com/linux/fedora/docker-ce.repo

erreurs “cgroups: cannot found cgroup mount destination: unknown”

Cette erreur apparait sur fedora 32 suite au passage à cgroupv2

  • Correction temporaire
1
2
mkdir /sys/fs/cgroup/systemd
mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd
  • plus perenne: rollback de cgroupv2 vers cgroupv1
1
2
dnf install grubby
grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

Résolution DNS KO

Encore une erreur sur fedora 32 suite à un changement sur firewalld. Tout semble correct (build de l’image, configuration DNS du container, ping du réseau local, ..), mais impossible de faire une requéte DNS (“could not resolve host”).

1
2
3
4
5
6
7
$ sudo firewall-cmd --get-zone-of-interface=eno1
FedoraWorkstation
$ sudo firewall-cmd --zone=FedoraWorkstation --add-masquerade --permanent
success
$ sudo firewall-cmd --reload
success
$ sudo systemctl restart docker

Install sur raspberry

  • cas générique

curl -fsSL get.docker.com -o get-docker.sh

sudo sh get-docker.sh

  • cas particulier du pi zero W
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pi@p-zero-0001:~ $ apt-cache madison docker-ce
docker-ce | 5:19.03.1~3-0~raspbian-stretch | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 5:19.03.0~3-0~raspbian-stretch | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 5:18.09.0~3-0~raspbian-stretch | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.06.3~ce~3-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.06.2~ce~3-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.06.1~ce~3-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.06.0~ce~3-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.03.1~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 18.03.0~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 17.12.1~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 17.12.0~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 17.09.1~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
docker-ce | 17.09.0~ce-0~raspbian | https://download.docker.com/linux/raspbian stretch/stable armhf Packages
pi@p-zero-0001:~ $ sudo apt-get install docker-ce=18.06.3~ce~3-0~raspbian

Créer un depot multi arch

https://hub.docker.com/r/ckulka/multi-arch-example

1
2
3
4
5
6
7
8
9
10
# Build the images on their respective platforms
docker build -t ckulka/multi-arch-example:amd64 -f Dockerfile.amd64 .
docker push ckulka/multi-arch-example:amd64

docker build -t ckulka/multi-arch-example:arm32v7 -f Dockerfile.arm32v7 .
docker push ckulka/multi-arch-example:arm32v7

# Create and push the manifest
docker manifest create ckulka/multi-arch-example:latest ckulka/multi-arch-example:amd64 ckulka/multi-arch-example:arm32v7
docker manifest push ckulka/multi-arch-example:latest