Docker Engine 23.0.1をAlmaLinux 8.7 on Raspberry Pi 4 Model Bへインストール
目次
概要
Raspberry Pi 4 Model Bで稼働するAlmaLinux 8.7上にDocker Engineをインストールします。 公式マニュアルにインストール手順が掲載されており、CentOS用のインストール手順のとおりに実行してインストールできました。 RHEL用のインストール手順も使えそうな気がして試してみましたが、2023/3/12時点でRHEL向けのリポジトリではARM版のパッケージが提供されていなくてインストールできませんでした。
構成
サーバ構成
ハードウェア
Raspberry Pi 4 Model B 4GB
OS
AlmaLinux release 8.7 (Stone Smilodon)
パッケージ
※依存パッケージは掲載を省略
- containerd.io-1.6.18-3.1.el8.aarch64.rpm
- docker-buildx-plugin-0.10.2-1.el8.aarch64.rpm
- docker-ce-23.0.1-1.el8.aarch64.rpm
- docker-ce-cli-23.0.1-1.el8.aarch64.rpm
- docker-compose-plugin-2.16.0-1.el8.aarch64.rpm
環境構築
インストール
古いバージョンのDockerをアンインストール
最新バージョンのDocker Engineをインストールする前に、古いバージョンのDocker関連パッケージをアンインストールします。 利用したAlmaLinux環境ではDockerはインストールされていなかったため事前にアンインストールする必要はありませんでした。 下記コマンドでインストール済パッケージ名が表示された場合は dnf remove コマンドでアンインストールしてください。
# dnf list installed | grep docker
※何も表示されなかったので本環境ではインストール済Dockerは存在しなかった
リポジトリ設定ユーティリティのインストール
Docker Engineをインストールする前に、Dockerリポジトリを設定するためのリポジトリ設定ユーティリティをインストールします。
# dnf -y install yum-utils Last metadata expiration check: 0:49:11 ago on Thu 09 Mar 2023 01:53:22 AM JST. Dependencies resolved. ================================================================================================================================================================ Package Architecture Version Repository Size ================================================================================================================================================================ Installing: yum-utils noarch 4.0.21-14.1.el8 baseos 73 k Transaction Summary ================================================================================================================================================================ Install 1 Package Total download size: 73 k Installed size: 23 k Downloading Packages: yum-utils-4.0.21-14.1.el8.noarch.rpm 484 kB/s | 73 kB 00:00 ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 67 kB/s | 73 kB 00:01 AlmaLinux 8 - BaseOS 3.1 MB/s | 3.4 kB 00:00 Importing GPG key 0xC21AD6EA: Userid : "AlmaLinux <packager@almalinux.org>" Fingerprint: E53C F5EF 91CE B0AD 1812 ECB8 51D6 647E C21A D6EA From : /etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : yum-utils-4.0.21-14.1.el8.noarch 1/1 Running scriptlet: yum-utils-4.0.21-14.1.el8.noarch 1/1 Verifying : yum-utils-4.0.21-14.1.el8.noarch 1/1 Installed: yum-utils-4.0.21-14.1.el8.noarch Complete!
Dockerリポジトリの追加
リポジトリ追加ユーティリティを使用して、Dockerリポジトリを追加します。
# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo ←Dcokerリポジトリの追加 Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo # ls -l /etc/yum.repos.d/ total 36 -rw-r--r--. 1 root root 943 Nov 10 07:12 almalinux-ha.repo -rw-r--r--. 1 root root 885 Nov 10 07:12 almalinux-plus.repo -rw-r--r--. 1 root root 963 Nov 10 07:12 almalinux-powertools.repo -rw-r--r--. 1 root root 978 Oct 6 2021 almalinux-raspberrypi.repo -rw-r--r--. 1 root root 2666 Nov 10 07:12 almalinux.repo -rw-r--r--. 1 root root 1041 Nov 10 07:12 almalinux-resilientstorage.repo -rw-r--r--. 1 root root 928 Nov 10 07:12 almalinux-saphana.repo -rw-r--r--. 1 root root 873 Nov 10 07:12 almalinux-sap.repo -rw-r--r-- 1 root root 1919 Mar 9 02:56 docker-ce.repo ←追加された
Docker Engineのインストール
Docker Engineをインストールします。
# dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin Docker CE Stable - aarch64 140 kB/s | 35 kB 00:00 Dependencies resolved. ================================================================================================================================================================ Package Architecture Version Repository Size ================================================================================================================================================================ Installing: containerd.io aarch64 1.6.18-3.1.el8 docker-ce-stable 25 M docker-buildx-plugin aarch64 0.10.2-1.el8 docker-ce-stable 10 M docker-ce aarch64 3:23.0.1-1.el8 docker-ce-stable 14 M docker-ce-cli aarch64 1:23.0.1-1.el8 docker-ce-stable 6.2 M docker-compose-plugin aarch64 2.16.0-1.el8 docker-ce-stable 9.4 M Installing dependencies: checkpolicy aarch64 2.9-1.el8 baseos 329 k container-selinux noarch 2:2.189.0-1.module_el8.7.0+3407+95aa0ca9 appstream 59 k docker-ce-rootless-extras aarch64 23.0.1-1.el8 docker-ce-stable 4.2 M fuse-common aarch64 3.3.0-16.el8 baseos 21 k fuse-overlayfs aarch64 1.9-1.module_el8.7.0+3407+95aa0ca9 appstream 67 k fuse3 aarch64 3.3.0-16.el8 baseos 52 k fuse3-libs aarch64 3.3.0-16.el8 baseos 90 k libcgroup aarch64 0.41-19.el8 baseos 67 k libslirp aarch64 4.4.0-1.module_el8.7.0+3407+95aa0ca9 appstream 65 k policycoreutils-python-utils noarch 2.9-20.el8 baseos 252 k python3-audit aarch64 3.0.7-4.el8 baseos 84 k python3-libsemanage aarch64 2.9-9.el8_6 baseos 125 k python3-policycoreutils noarch 2.9-20.el8 baseos 2.2 M python3-setools aarch64 4.3.0-3.el8 baseos 527 k slirp4netns aarch64 1.2.0-2.module_el8.7.0+3407+95aa0ca9 appstream 52 k tar aarch64 2:1.30-6.el8_7.1 baseos 829 k Enabling module streams: container-tools rhel8 Transaction Summary ================================================================================================================================================================ Install 21 Packages Total download size: 74 M Installed size: 310 M Downloading Packages: (1/21): fuse-common-3.3.0-16.el8.aarch64.rpm 139 kB/s | 21 kB 00:00 (2/21): fuse3-3.3.0-16.el8.aarch64.rpm 323 kB/s | 52 kB 00:00 (3/21): checkpolicy-2.9-1.el8.aarch64.rpm 1.6 MB/s | 329 kB 00:00 (4/21): libcgroup-0.41-19.el8.aarch64.rpm 848 kB/s | 67 kB 00:00 (5/21): policycoreutils-python-utils-2.9-20.el8.noarch.rpm 3.6 MB/s | 252 kB 00:00 (6/21): fuse3-libs-3.3.0-16.el8.aarch64.rpm 714 kB/s | 90 kB 00:00 (7/21): python3-audit-3.0.7-4.el8.aarch64.rpm 1.2 MB/s | 84 kB 00:00 (8/21): python3-libsemanage-2.9-9.el8_6.aarch64.rpm 1.5 MB/s | 125 kB 00:00 (9/21): python3-setools-4.3.0-3.el8.aarch64.rpm 4.0 MB/s | 527 kB 00:00 (10/21): tar-1.30-6.el8_7.1.aarch64.rpm 5.7 MB/s | 829 kB 00:00 (11/21): container-selinux-2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch.rpm 926 kB/s | 59 kB 00:00 (12/21): python3-policycoreutils-2.9-20.el8.noarch.rpm 6.7 MB/s | 2.2 MB 00:00 (13/21): fuse-overlayfs-1.9-1.module_el8.7.0+3407+95aa0ca9.aarch64.rpm 477 kB/s | 67 kB 00:00 (14/21): libslirp-4.4.0-1.module_el8.7.0+3407+95aa0ca9.aarch64.rpm 494 kB/s | 65 kB 00:00 (15/21): slirp4netns-1.2.0-2.module_el8.7.0+3407+95aa0ca9.aarch64.rpm 1.1 MB/s | 52 kB 00:00 (16/21): docker-buildx-plugin-0.10.2-1.el8.aarch64.rpm 3.3 MB/s | 10 MB 00:03 (17/21): docker-ce-23.0.1-1.el8.aarch64.rpm 3.6 MB/s | 14 MB 00:04 (18/21): containerd.io-1.6.18-3.1.el8.aarch64.rpm 4.6 MB/s | 25 MB 00:05 (19/21): docker-ce-cli-23.0.1-1.el8.aarch64.rpm 2.2 MB/s | 6.2 MB 00:02 (20/21): docker-ce-rootless-extras-23.0.1-1.el8.aarch64.rpm 2.0 MB/s | 4.2 MB 00:02 (21/21): docker-compose-plugin-2.16.0-1.el8.aarch64.rpm 3.9 MB/s | 9.4 MB 00:02 ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 7.1 MB/s | 74 MB 00:10 Docker CE Stable - aarch64 19 kB/s | 1.6 kB 00:00 Importing GPG key 0x621E9F35: Userid : "Docker Release (CE rpm) <docker@docker.com>" Fingerprint: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35 From : https://download.docker.com/linux/centos/gpg Key imported successfully Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : docker-compose-plugin-2.16.0-1.el8.aarch64 1/21 Running scriptlet: docker-compose-plugin-2.16.0-1.el8.aarch64 1/21 Installing : fuse3-libs-3.3.0-16.el8.aarch64 2/21 Running scriptlet: fuse3-libs-3.3.0-16.el8.aarch64 2/21 Installing : docker-buildx-plugin-0.10.2-1.el8.aarch64 3/21 Running scriptlet: docker-buildx-plugin-0.10.2-1.el8.aarch64 3/21 Installing : docker-ce-cli-1:23.0.1-1.el8.aarch64 4/21 Running scriptlet: docker-ce-cli-1:23.0.1-1.el8.aarch64 4/21 Installing : libslirp-4.4.0-1.module_el8.7.0+3407+95aa0ca9.aarch64 5/21 Installing : slirp4netns-1.2.0-2.module_el8.7.0+3407+95aa0ca9.aarch64 6/21 Installing : tar-2:1.30-6.el8_7.1.aarch64 7/21 Running scriptlet: tar-2:1.30-6.el8_7.1.aarch64 7/21 Installing : python3-setools-4.3.0-3.el8.aarch64 8/21 Installing : python3-libsemanage-2.9-9.el8_6.aarch64 9/21 Installing : python3-audit-3.0.7-4.el8.aarch64 10/21 Running scriptlet: libcgroup-0.41-19.el8.aarch64 11/21 Installing : libcgroup-0.41-19.el8.aarch64 11/21 Running scriptlet: libcgroup-0.41-19.el8.aarch64 11/21 Installing : fuse-common-3.3.0-16.el8.aarch64 12/21 Installing : fuse3-3.3.0-16.el8.aarch64 13/21 Installing : fuse-overlayfs-1.9-1.module_el8.7.0+3407+95aa0ca9.aarch64 14/21 Running scriptlet: fuse-overlayfs-1.9-1.module_el8.7.0+3407+95aa0ca9.aarch64 14/21 Installing : checkpolicy-2.9-1.el8.aarch64 15/21 Installing : python3-policycoreutils-2.9-20.el8.noarch 16/21 Installing : policycoreutils-python-utils-2.9-20.el8.noarch 17/21 Running scriptlet: container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch 18/21 Installing : container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch 18/21 Running scriptlet: container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch 18/21 Installing : containerd.io-1.6.18-3.1.el8.aarch64 19/21 Running scriptlet: containerd.io-1.6.18-3.1.el8.aarch64 19/21 Installing : docker-ce-rootless-extras-23.0.1-1.el8.aarch64 20/21 Running scriptlet: docker-ce-rootless-extras-23.0.1-1.el8.aarch64 20/21 Installing : docker-ce-3:23.0.1-1.el8.aarch64 21/21 Running scriptlet: docker-ce-3:23.0.1-1.el8.aarch64 21/21 Running scriptlet: container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch 21/21 Running scriptlet: docker-ce-3:23.0.1-1.el8.aarch64 21/21 Verifying : checkpolicy-2.9-1.el8.aarch64 1/21 Verifying : fuse-common-3.3.0-16.el8.aarch64 2/21 Verifying : fuse3-3.3.0-16.el8.aarch64 3/21 Verifying : fuse3-libs-3.3.0-16.el8.aarch64 4/21 Verifying : libcgroup-0.41-19.el8.aarch64 5/21 Verifying : policycoreutils-python-utils-2.9-20.el8.noarch 6/21 Verifying : python3-audit-3.0.7-4.el8.aarch64 7/21 Verifying : python3-libsemanage-2.9-9.el8_6.aarch64 8/21 Verifying : python3-policycoreutils-2.9-20.el8.noarch 9/21 Verifying : python3-setools-4.3.0-3.el8.aarch64 10/21 Verifying : tar-2:1.30-6.el8_7.1.aarch64 11/21 Verifying : container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch 12/21 Verifying : fuse-overlayfs-1.9-1.module_el8.7.0+3407+95aa0ca9.aarch64 13/21 Verifying : libslirp-4.4.0-1.module_el8.7.0+3407+95aa0ca9.aarch64 14/21 Verifying : slirp4netns-1.2.0-2.module_el8.7.0+3407+95aa0ca9.aarch64 15/21 Verifying : containerd.io-1.6.18-3.1.el8.aarch64 16/21 Verifying : docker-buildx-plugin-0.10.2-1.el8.aarch64 17/21 Verifying : docker-ce-3:23.0.1-1.el8.aarch64 18/21 Verifying : docker-ce-cli-1:23.0.1-1.el8.aarch64 19/21 Verifying : docker-ce-rootless-extras-23.0.1-1.el8.aarch64 20/21 Verifying : docker-compose-plugin-2.16.0-1.el8.aarch64 21/21 Installed: checkpolicy-2.9-1.el8.aarch64 container-selinux-2:2.189.0-1.module_el8.7.0+3407+95aa0ca9.noarch containerd.io-1.6.18-3.1.el8.aarch64 docker-buildx-plugin-0.10.2-1.el8.aarch64 docker-ce-3:23.0.1-1.el8.aarch64 docker-ce-cli-1:23.0.1-1.el8.aarch64 docker-ce-rootless-extras-23.0.1-1.el8.aarch64 docker-compose-plugin-2.16.0-1.el8.aarch64 fuse-common-3.3.0-16.el8.aarch64 fuse-overlayfs-1.9-1.module_el8.7.0+3407+95aa0ca9.aarch64 fuse3-3.3.0-16.el8.aarch64 fuse3-libs-3.3.0-16.el8.aarch64 libcgroup-0.41-19.el8.aarch64 libslirp-4.4.0-1.module_el8.7.0+3407+95aa0ca9.aarch64 policycoreutils-python-utils-2.9-20.el8.noarch python3-audit-3.0.7-4.el8.aarch64 python3-libsemanage-2.9-9.el8_6.aarch64 python3-policycoreutils-2.9-20.el8.noarch python3-setools-4.3.0-3.el8.aarch64 slirp4netns-1.2.0-2.module_el8.7.0+3407+95aa0ca9.aarch64 tar-2:1.30-6.el8_7.1.aarch64 Complete!
設定
Docker Engineの自動起動有効化とサービスの起動
Docker Engineインストール直後は自動起動が無効になっていて、サービスも停止しています。 自動起動有効化と同時にサービスの起動を行います。
# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) ←自動起動無効 Active: inactive (dead) ←停止状態 Docs: https://docs.docker.com # systemctl --now enable docker ←自動起動を有効化しDockerサービスを起動 Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service. # systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) ←自動起動有効 Active: active (running) since Thu 2023-03-09 03:02:44 JST; 13s ago ←起動状態 Docs: https://docs.docker.com Main PID: 11461 (dockerd) Tasks: 9 CGroup: /system.slice/docker.service mq11461 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.033119010+09:00" level=info msg="Loading containers: done." Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096017595+09:00" level=warning msg="WARNING: No memory limit support" Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096097261+09:00" level=warning msg="WARNING: No swap limit support" Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096120168+09:00" level=warning msg="WARNING: No kernel memory TCP limit support" Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096142612+09:00" level=warning msg="WARNING: No oom kill disable support" Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096199796+09:00" level=info msg="Docker daemon" commit=bc3805a graphdriver=overlay2 version=> Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.096550773+09:00" level=info msg="Daemon has completed initialization" Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.189819555+09:00" level=info msg="[core] [Server #7] Server created" module=grpc Mar 09 03:02:44 RPi4B4GB systemd[1]: Started Docker Application Container Engine. Mar 09 03:02:44 RPi4B4GB dockerd[11461]: time="2023-03-09T03:02:44.204882756+09:00" level=info msg="API listen on /run/docker.sock"
インストール後の確認
インストール後に最低限dockerコマンドが実行できることを確認します。
# docker -v Docker version 23.0.1, build a5ee5b1