LoginSignup
2
3

More than 5 years have passed since last update.

Raspberry PIでdocker

Last updated at Posted at 2019-02-17

Getting started with Docker on your Raspberry Pi
https://blog.hypriot.com/getting-started-with-docker-on-your-arm-device/

Arm docker hub
https://hub.docker.com/u/armhf/

導入

$ sudo apt install docker
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
以下のパッケージが自動でインストールされましたが、もう必要とされていません:
  realpath
これを削除するには 'sudo apt autoremove' を利用してください。
以下のパッケージが新たにインストールされます:
  docker
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 0 個。
11.7 kB のアーカイブを取得する必要があります。
この操作後に追加で 21.5 kB のディスク容量が消費されます。
取得:1 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf docker armhf 1.5-1 [11.7 kB]
11.7 kB を 1秒 で取得しました (10.3 kB/s)
以前に未選択のパッケージ docker を選択しています。
(データベースを読み込んでいます ... 現在 134337 個のファイルとディレクトリがインストールされています。)
.../docker_1.5-1_armhf.deb を展開する準備をしています ...
docker (1.5-1) を展開しています...
man-db (2.7.6.1-2) のトリガを処理しています ...
docker (1.5-1) を設定しています ...

実行

 $ docker run -d -p 80:80 hypriot/rpi-busybox-httpd
bash: docker: コマンドが見つかりません
 $ sudo find / -name docker -print
find: ‘/run/user/1000/gvfs’: 許可がありません
find: ‘/proc/734/task/734/net’: 無効な引数です
find: ‘/proc/734/net’: 無効な引数です
/usr/share/menu/docker
/usr/share/doc/docker
$ uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

re install

$ sudo apt-get install \

apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common

パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています

状態情報を読み取っています... 完了
apt-transport-https はすでに最新バージョン (1.4.9) です。
ca-certificates はすでに最新バージョン (20161130+nmu1+deb9u1) です。
curl はすでに最新バージョン (7.52.1-5+deb9u9) です。
以下の追加パッケージがインストールされます:
gir1.2-packagekitglib-1.0 python3-pycurl python3-software-properties
unattended-upgrades
提案パッケージ:
libcurl4-gnutls-dev python-pycurl-doc python3-pycurl-dbg bsd-mailx
mail-transport-agent needrestart
以下のパッケージが新たにインストールされます:
gir1.2-packagekitglib-1.0 gnupg2 python3-pycurl python3-software-properties
software-properties-common unattended-upgrades
アップグレード: 0 個、新規インストール: 6 個、削除: 0 個、保留: 0 個。
587 kB のアーカイブを取得する必要があります。
この操作後に追加で 1,445 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf gir1.2-packagekitglib-1.0 armhf 1.1.5-2+deb9u1 [34.7 kB]
取得:2 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf gnupg2 all 2.1.18-8~deb9u4 [299 kB]
取得:3 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf python3-pycurl armhf 7.43.0-2 [58.4 kB]
取得:4 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf python3-software-properties all 0.96.20.2-1 [49.5 kB]
取得:5 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf software-properties-common all 0.96.20.2-1 [83.6 kB]
取得:6 http://ftp.jaist.ac.jp/pub/Linux/raspbian-archive/raspbian stretch/main armhf unattended-upgrades all 0.93.1+nmu1 [61.7 kB]
587 kB を 5秒 で取得しました (115 kB/s)

パッケージを事前設定しています ...
以前に未選択のパッケージ gir1.2-packagekitglib-1.0 を選択しています。
(データベースを読み込んでいます ... 現在 134333 個のファイルとディレクトリがインストールされています。)
.../0-gir1.2-packagekitglib-1.0_1.1.5-2+deb9u1_armhf.deb を展開する準備をしています ...
gir1.2-packagekitglib-1.0 (1.1.5-2+deb9u1) を展開しています...
以前に未選択のパッケージ gnupg2 を選択しています。
.../1-gnupg2_2.1.18-8~deb9u4_all.deb を展開する準備をしています ...
gnupg2 (2.1.18-8~deb9u4) を展開しています...
以前に未選択のパッケージ python3-pycurl を選択しています。
.../2-python3-pycurl_7.43.0-2_armhf.deb を展開する準備をしています ...
python3-pycurl (7.43.0-2) を展開しています...
以前に未選択のパッケージ python3-software-properties を選択しています。
.../3-python3-software-properties_0.96.20.2-1_all.deb を展開する準備をしています ...
python3-software-properties (0.96.20.2-1) を展開しています...
以前に未選択のパッケージ software-properties-common を選択しています。
.../4-software-properties-common_0.96.20.2-1_all.deb を展開する準備をしています ...
software-properties-common (0.96.20.2-1) を展開しています...
以前に未選択のパッケージ unattended-upgrades を選択しています。
.../5-unattended-upgrades_0.93.1+nmu1_all.deb を展開する準備をしています ...
unattended-upgrades (0.93.1+nmu1) を展開しています...
python3-pycurl (7.43.0-2) を設定しています ...
gnupg2 (2.1.18-8~deb9u4) を設定しています ...
systemd (232-25+deb9u8) のトリガを処理しています ...
unattended-upgrades (0.93.1+nmu1) を設定しています ...

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable unattended-upgrades
man-db (2.7.6.1-2) のトリガを処理しています ...
gir1.2-packagekitglib-1.0 (1.1.5-2+deb9u1) を設定しています ...
python3-software-properties (0.96.20.2-1) を設定しています ...
dbus (1.10.26-0+deb9u1) のトリガを処理しています ...
software-properties-common (0.96.20.2-1) を設定しています ...
systemd (232-25+deb9u8) のトリガを処理しています ...
dbus (1.10.26-0+deb9u1) のトリガを処理しています ...

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
OK

$ sudo find / -name gpg -print
find: ‘/run/user/1000/gvfs’: 許可がありません
find: ‘/proc/734/task/734/net’: 無効な引数です
find: ‘/proc/734/net’: 無効な引数です
/usr/bin/gpg
/usr/share/bash-completion/completions/gpg

sudo apt-key fingerprint 2D2D2D0A
pi@raspberrypi:~/Desktop $ sudo add-apt-repository \

"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in init
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)

File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 89, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Raspbian/stretch

docker on Raspberry Pi in Qiita

Raspberry Pi 3 Model B(Raspbian)にDockerをインストールする
https://qiita.com/yuyakato/items/1cdc7fa511f7767c95ac

Raspberry Pi用docker-composeの構築
https://qiita.com/tkyonezu/items/ceaaf41924df39254058

RaspberryPi3(ラズパイ)にDockerとGitをインストール
https://qiita.com/RyosukeKamei/items/147948845cd4c2c1d7b4

RaspberryPi3(ラズパイ)にDockerでPython+bottle+MySQL環境構築する!【簡単構築編】
https://qiita.com/RyosukeKamei/items/746825f6ca039feb8cfa

RaspberryPi3(ラズパイ)にDockerでPython+bottle+MySQL環境構築する!【試行錯誤編】
https://qiita.com/RyosukeKamei/items/5905240b4807fab00bc6

Raspberry Pi 3(ラズパイ)を使って温度を自動計測し、自動的にサーバ上(Docker python3+bottle+MySQL)にアップして閲覧する!
https://qiita.com/RyosukeKamei/items/075ba9687396319c0be5

.NetCoreをRaspberry Pi上のdockerでパッと動かすPiBakeryレシピ
https://qiita.com/mochimo/items/4566e854fab2eacfdcfe

Raspberry Pi 3 Model BにインストールしたDocker上からカメラを扱う
https://qiita.com/yuyakato/items/f5c2c86754a5b1c9504d

Docker on Raspberry PiのインストールとLチカ
https://qiita.com/ykshr/items/c78eb72e3ee75664a5fe

文書履歴(document history)

ver. 0.01 初稿 20190217
ver. 0.02 はてなURL追記 20190218

このエントリーをはてなブックマークに追加

2
3
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
2
3