12
12

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 Pi2でdockerを使う(Snappy Ubuntu Core)

Last updated at Posted at 2015-07-14
  • RaspberryPi2 + SD4GB

感想

  • RaspberryPIホスト自体はネットワーク設定程度しか変更しない、という発想が大変気に入った。

参考

ダウンロード

ログイン

  • ubuntu / ubuntu
ipアドレス確認
ip a
ssh ubuntu@snappy_ip

状況

SDカードの空き
$ df -h | grep G
/dev/mmcblk0p4               1.6G   29M  1.4G   2% /oem
メモリの空き
(RaspberryPi2)ubuntu@localhost:~$ free -m
             total       used       free     shared    buffers     cached
Mem:           924        143        780         12          7        100
-/+ buffers/cache:         36        888
Swap:            0          0          0
$ uname -r
3.19.1-11-generic-bcm2709
(RaspberryPi2)ubuntu@localhost:~$ lsmod
Module                  Size  Used by
xt_addrtype            16384  2 
xt_conntrack           16384  1 
ipt_MASQUERADE         16384  1 
nf_nat_masquerade_ipv4    16384  1 ipt_MASQUERADE
iptable_nat            16384  1 
nf_conntrack_ipv4      20480  2 
nf_defrag_ipv4         16384  1 nf_conntrack_ipv4
nf_nat_ipv4            16384  1 iptable_nat
iptable_filter         16384  1 
ip_tables              24576  2 iptable_filter,iptable_nat
x_tables               20480  5 ip_tables,ipt_MASQUERADE,xt_conntrack,iptable_filter,xt_addrtype
nf_nat                 20480  2 nf_nat_ipv4,nf_nat_masquerade_ipv4
nf_conntrack           81920  5 nf_nat,nf_nat_ipv4,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4
bridge                 98304  0 
aufs                  204800  0 
joydev                 20480  0 
evdev                  20480  0 
uio_pdrv_genirq        16384  0 
uio                    20480  1 uio_pdrv_genirq

exFATには対応していないが、cifs, xfs, hfs, nfsなどに対応している。

  • cat /proc/filesystems
  • ls /lib/modules/3.19.1-11-generic-bcm2709/kernel/fs/

dockerのインストール手順

WebUIからインストール

WebDMからSnappy Storeにアクセス

  • http://snappy_ip:4200/

1.png

2.png

CLIから

sudo snappy install docker
$ docker -v
Docker version 1.6.1, build 7f761fb
docker run -it tukiyo3/rpi-ja /bin/bash

docker build

Dockerfile
FROM tukiyo3/rpi-ja

RUN apt-get update &&\
    apt-get install -y nginx &&\
    rm -rf /var/lib/apt/lists/*

EXPOSE  80
ENTRYPOINT /usr/sbin/nginx && tail -f /dev/null
build
cat Dockerfile | docker build -

IPの固定

  • /etc/network/interfaces.d/eth0

を編集すればよさそう

その他

  • systemctl, journalctlなどが使われている。
12
12
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
12
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?