Problém s modulem overlay
Postup níže napoprvé skončil chybou protože jsem neměl nahrán modul overlay.
Konkrétně hodilo chybu po spuštění shell scriptu „get-docker.sh“ v příkazu „sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin“.
Průzkumem logů jsem zjistil, že problém je asi v neexistujícím modulu overlay (failed to mount overlay: no such device …). Našel jsem dotaz na stackoverflow zde.
V následujícím výpisu overlay ani overlay2 nebyl
sudo lsmod | grep overlay
a při pokusu o nahrání overlay nebo overlay2 pomocí modprobe házelo chybu chybu
sudo modprobe overlay modprobe: FATAL: Module overlay not found in directory /lib/modules/5.10.103-v7+
Podle tipu ve výše zmíněném příspěvku jsem provedl update kernelu
sudo apt install --reinstall raspberrypi-bootloader raspberrypi-kernel sudo reboot
Poté již byl v seznamu nahraných modulů overlay
sudo lsmod | grep overlay overlay 110592 0
Poté již instalace pomocí skriptu níže prošla
Instalace dockeru
Postupoval jsem podle návodu zde.
curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh
Výpis skriptu u mně:
pi@xxxxx:~ $ sudo sh get-docker.sh # Executing docker install script, commit: 98a5ca00c407c75cfb740d6398726db551db0f38 + sh -c apt-get update -qq >/dev/null + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null + sh -c mkdir -p /etc/apt/keyrings && chmod -R 0755 /etc/apt/keyrings + sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg + sh -c chmod a+r /etc/apt/keyrings/docker.gpg + sh -c echo "deb [arch=armhf signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/raspbian buster stable" > /etc/apt/sources.list.d/docker.list + sh -c apt-get update -qq >/dev/null + sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin >/dev/null + sh -c docker version Client: Docker Engine - Community Version: 23.0.2 API version: 1.42 Go version: go1.19.7 Git commit: 569dd73 Built: Mon Mar 27 16:16:04 2023 OS/Arch: linux/arm Context: default Server: Docker Engine - Community Engine: Version: 23.0.2 API version: 1.42 (minimum version 1.12) Go version: go1.19.7 Git commit: 219f21b Built: Mon Mar 27 16:16:04 2023 OS/Arch: linux/arm Experimental: false containerd: Version: 1.6.20 GitCommit: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc: Version: 1.1.5 GitCommit: v1.1.5-0-gf19387a docker-init: Version: 0.19.0 GitCommit: de40ad0 ================================================================================ To run Docker as a non-privileged user, consider setting up the Docker daemon in rootless mode for your user: dockerd-rootless-setuptool.sh install Visit https://docs.docker.com/go/rootless/ to learn about rootless mode. To run the Docker daemon as a fully privileged service, but granting non-root users access, refer to https://docs.docker.com/go/daemon-access/ WARNING: Access to the remote API on a privileged Docker daemon is equivalent to root access on the host. Refer to the 'Docker daemon attack surface' documentation for details: https://docs.docker.com/go/attack-surface/
Test
docker -v Docker version 23.0.2, build 569dd73
A hello world
docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 04341b189be6: Pull complete Digest: sha256:ffb13da98453e0f04d33a6eee5bb8e46ee50d08ebe17735fc0779d0349e889e9 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (arm32v7) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/