LoginSignup
17
12

More than 3 years have passed since last update.

Raspbian Busterにdockerをインストールする

Last updated at Posted at 2019-07-03

Rasberry pi 4が海外で発売開始されたことを横目に見ながら、Rasberry pi 3+を購入しました。NoobsでインストールされるOSはRaspbian Busterですが、Dockerのインストールがうまく行かなかったのでメモとして残しておきます。(どうやらこれに当たったようです。)

やり方

まずは最新化しておきます。

sudo apt update && sudo apt dist-upgrade 

次にDockerのインストールをします。

curl -sSL https://get.docker.com | sh

ところが、Dockerがインストールされずにエラーが発生します。設定ファイルを確認すると

# /etc/apt/sources.list.d/docker.list
deb [arch=armhf] http://download.docker.com/linux/raspbian 10 stable

となっています。一方、執筆時点でDockerがraspbian向けに提供しているのはjessieとstrechです。

しかたないので、Dockerが提供しているdebian/buster向けに設定を変更してインストールしてみましょう。

# /etc/apt/sources.list.d/docker.list
deb [arch=armhf] http://download.docker.com/linux/debian buster stable
sudo apt update && sudo apt install docker-ce docker-ce-cli

このインストールはDockerが依存しているaufs-dkmsでエラーが発生します。

Error! Bad return status for module build on kernel: 4.19.50+ (armv7l)
Consult /var/lib/dkms/aufs/4.19+20190211/build/make.log for more information.
dpkg: error processing package aufs-dkms (--configure):
 installed aufs-dkms package post-installation script subprocess returned error exit status 10

パッケージの状態を確認します。

sudo dpkg --audit

どうやらConfigureで失敗しているようなので、悪さしているファイルを削除します。

sudo rm /var/lib/dpkg/info/aufs-dkms.postinst
sudo rm /var/lib/dpkg/info/aufs-dkms.prerm

そして、再度configureする。

sudo dpkg --configure aufs-dkms

これでエラーが解消されました。最後にDockerの動作確認します。

$ sudo docker run hello-world

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/

動きました。

参考

17
12
1

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
17
12