2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[メモ] Raspberry Pi で、Docker (docker.com純正? raspbian/jessie対応版)

Last updated at Posted at 2016-09-03

the latest release officially includes Raspbian Jessie installation support.

  • (Dockerの)最新のリリースで正式にRaspbian Jessieへのインストールをサポートしたよ、とのこと。

概要

環境

  • Raspberry Pi 3
  • 2016-05-27-raspbian-jessie-lite.img

手順

  1. Raspbianを焼く

  2. もろもろの設定

  3. dockerインストール

    1. curl -sSL get.docker.com | sh
      dockerインストールスクリプト実行... 待つ
    2. sudo usermod -aG docker pi
      ユーザpiをグループdockerに追加して、一度ログアウトする... と、rootでないユーザーでもDockerが使える、とのこと

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

      sudo usermod -aG docker pi

    Remember that you will have to log out and back in for this to take effect!

4. 軽く使ってみる
    - `docker run -ti resin/rpi-raspbian:jessie /bin/bash`<br>=> 初回時はdockerイメージのダウンロードされる。
  
 



## 実行例

```shell-session
pi@raspberrypi:~ $ time curl -sSL get.docker.com | sh
+ sudo -E sh -c mkdir -p /etc/systemd/system/docker.service.d
+ sudo -E sh -c echo '[Service]\nExecStart=\nExecStart=/usr/bin/dockerd --storage-driver overlay -H fd://' > /etc/systemd/system/docker.service.d/overlay.conf
+ sudo -E sh -c sleep 3; apt-get update
Get:1 http://mirrordirector.raspbian.org jessie InRelease [14.9 kB]
Get:2 http://archive.raspberrypi.org jessie InRelease [13.2 kB]
.
.
.
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Processing triggers for systemd (215-17+deb8u4) ...
+ sudo -E sh -c docker version
Client:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:31:15 2016
 OS/Arch:      linux/arm

Server:
 Version:      1.12.1
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   23cf638
 Built:        Thu Aug 18 05:31:15 2016
 OS/Arch:      linux/arm

If you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker pi

Remember that you will have to log out and back in for this to take effect!


real	4m36.065s
user	0m46.370s
sys	0m12.900s
pi@raspberrypi:~ $ sudo usermod -aG docker pi
pi@raspberrypi:~ $ exit
logout
.
.
## 再ログイン.

pi@raspberrypi:~ $ docker run -ti resin/rpi-raspbian:jessie /bin/bash
Unable to find image 'resin/rpi-raspbian:jessie' locally
jessie: Pulling from resin/rpi-raspbian
2c21a521f21e: Pull complete 
d99cff50dc11: Pull complete 
c1c51ee47f0b: Pull complete 
e8b3c50e8e7e: Pull complete 
a3ed95caeb02: Pull complete 
7f56c2fb9a9c: Pull complete 
75010306b0df: Pull complete 
8837443d430d: Pull complete 
23dd9b04a2ec: Pull complete 
Digest: sha256:b6aef386a6da25bfbcba0e14a748e5473ff798233155fad960ae08fa4c94b146
Status: Downloaded newer image for resin/rpi-raspbian:jessie
root@d302245ade81:/# cat /etc/issue
Raspbian GNU/Linux 8 \n \l

root@d302245ade81:/# exit
exit
pi@raspberrypi:~ $ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
resin/rpi-raspbian   jessie              0c648c095aee        3 days ago          117.2 MB
pi@raspberrypi:~ $ docker run -ti resin/rpi-raspbian:jessie /bin/bash   ##2度目はイメージのダウンロードしない.
root@75c79a527f8a:/# ls
bin  boot  dev	etc  home  lib	media  mnt  opt  proc  root  run  sbin	srv  sys  tmp  usr  var
root@75c79a527f8a:/# exit
exit
pi@raspberrypi:~ $ 
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?