LoginSignup
1
0

More than 3 years have passed since last update.

Kubernetes の環境を作りたい [Raspberry Pi 編 5] 32 bit OS に Docker がインストールできない

Last updated at Posted at 2021-03-31

[2021/3/31 追記]
32 bit のイメージで作業を進めてしまったところ Docker のインストールでどんづまったので 64 bit でやり直すことにしました。

(64 bit: aarch64)
http://ftp.yz.yamagata-u.ac.jp/pub/linux/centos-altarch/7.9.2009/isos/aarch64/images/

(32 bit: armhfp(armv7l))
http://ftp.yz.yamagata-u.ac.jp/pub/linux/centos-altarch/7.9.2009/isos/armhfp/
※ 以下の記事で利用したもの。

進捗ないです。

前回の失敗

前回

・Raspberry Pi 3 B+, Raspberry Pi 4 B の CPU は 64 bit。
・1 回目で用意した OS は 32 bit (CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4-2009-sda.raw.xz)

・どうやら CentOS (RHEL) 7 向けの Docker は概ね 64 bit 環境を想定しているらしい (そりゃそうか。。)。
・Raspberry Pi では Pi 2 とかとの互換性も考慮して 32 bit OS がまだ普及しているということかな?

こちらのページが大変参考になりました。ありがとうございます、、!!!

以降やること

先々を考えると 64 bit OS から入れなおした方が融通は効きそうな気もしますが、せっかくなのでこの環境でできるところまでやっておこうと思います。

というわけで、yum をあきらめてソースから。ありがたいことにインストール用のスクリプトが公開されているようですが、Warning にもあるように実際にダウンロードしたスクリプトの内容は確認してから実行したいと思います。

で、確認したんですが、https://download.docker.com/linux/static/stable/armhf/
という URL があったので、手でやってみようかな。。

こちらの記事が参考になりそうです。

半端になってしまったものの掃除

どこを見ても「Docker をビルドするのに Dokcer が必須」という禅問答のような文言があったので、前回インストールした containerd.io や追加したリポジトリを削除し、素の状態で yum install docker をやってみようと思います。
これで古い docker が入ってくれたらいいな。知らんけど。

# yum remove docker-ce docker-cli containerd.io
Loaded plugins: fastestmirror
No Match for argument: docker-ce
No Match for argument: docker-cli
Resolving Dependencies
--> Running transaction check
---> Package containerd.io.armv7hl 0:1.2.11-3.1.el7 will be erased
--> Finished Dependency Resolution
...

念のため docker-ce docker-cli も指定しましたが、containerd.io のみ (正しく)remove されました。

# rm docker-ce.repo
# yum repolist
(略)
repo id                          repo name                                status
base/7/armhfp                    CentOS-7 - Base                          7,455
centos-kernel/7/armhfp           CentOS LTS Kernels for armhfp               44
extras/7/armhfp                  CentOS-7 - Extras                          378
updates/7/armhfp                 CentOS-7 - Updates                       1,312
repolist: 9,189
# yum install docker
(略)
# systemctl start docker
# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
/usr/bin/docker-current: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See '/usr/bin/docker-current run --help'.

はい。

そういえば、容量は足りるんだろうか、、、。不安は募る。

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        14G  2.2G   12G  16% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  8.5M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mmcblk0p1  286M   57M  230M  20% /boot
tmpfs           383M     0  383M   0% /run/user/0
# yum install wget
# wget https://download.docker.com/linux/static/stable/armhf/docker-20.10.5.tgz --no-check-certificate

※ --no-check-certificate はよろしくないと思うけど、証明書は別途確認した、ということで。。

image.png

で、解凍したら、あれ?これソースじゃないの??

# pwd
/sources/docker
# ls -al
total 193884
drwxrwxr-x. 2 1000 1000     4096 Mar  2  2021 .
drwxr-xr-x. 3 root root     4096 Jan  1 01:29 ..
-rwxr-xr-x. 1 1000 1000 34599532 Mar  2  2021 containerd
-rwxr-xr-x. 1 1000 1000  6356992 Mar  2  2021 containerd-shim
-rwxr-xr-x. 1 1000 1000  8585216 Mar  2  2021 containerd-shim-runc-v2
-rwxr-xr-x. 1 1000 1000 18652452 Mar  2  2021 ctr
-rwxr-xr-x. 1 1000 1000 47289502 Mar  2  2021 docker
-rwxr-xr-x. 1 1000 1000 68103988 Mar  2  2021 dockerd
-rwxr-xr-x. 1 1000 1000   342340 Mar  2  2021 docker-init
-rwxr-xr-x. 1 1000 1000  2713383 Mar  2  2021 docker-proxy
-rwxr-xr-x. 1 1000 1000 11869388 Mar  2  2021 runc

Install daemon and client binaries on Linux
Prerequisites
Before attempting to install Docker from binaries, be sure your host machine meets the prerequisites:

A 64-bit installation

A 64-bit installation !!!!!!!!!!

解散(すぐ下に続く)。

こっちがソースみたいです。

# wget https://download.docker.com/linux/centos/7/source
/stable/Packages/docker-ce-20.10.5-3.el7.src.rpm --no-check-certificate

rpm っていっても yum install <これ> でインストールできるわけではないんですね。

ここからはこちらの記事を参考にさせていただきました。

# make static DOCKER_BUILD_PKGS=static-linux
fatal: Not a git repository (or any of the parent directories): .git
make: Warning: File `Makefile' has modification time 1614708431 s in the future
make: *** No rule to make target `static'.  Stop.
# make static DOCKER_BUILD_PKGS=static-linux
fatal: Not a git repository (or any of the parent directories): .git
make: Warning: File `Makefile' has modification time 1614708431 s in the future
make: *** No rule to make target `static'.  Stop.
# make DOCKER_BUILD_PKGS=static-linux
fatal: Not a git repository (or any of the parent directories): .git
make: Warning: File `Makefile' has modification time 1614708395 s in the future
docker build  --build-arg=GO_VERSION  -f "Dockerfile" --output=bundles/ --target=binary --build-arg VERSION --build-arg DOCKER_GITCOMMIT --build-arg PRODUCT --build-arg PLATFORM --build-arg DEFAULT_PRODUCT_LICENSE .
unknown flag: --output
See 'docker build --help'.
make: *** [binary] Error 125

、、、、、、、、

ふぅ。

続く。

どうしよう。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0