Armadilloフォーラム

G3LへのDockerインストールについて

ping94

2017年4月26日 16時26分

G3LへDockerをインストールしようと考えていますがうまくできません。

1.
インストール手順は下記のサイトの通りに行いました。
https://docs.docker.com/engine/installation/linux/debian/

2.
インストール後、systemctl status docker.serviceとコマンドを打ちましたが下記のように表示され、サービスが起動していないようです。
一応、リブートしてみましたが状況は同じでした。
root@armadillo:/home/atmark# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled)
Active: failed (Result: exit-code) since Wed 2017-04-26 16:05:22 JST; 24s ago
Docs: https://docs.docker.com
Process: 1933 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 1933 (code=exited, status=1/FAILURE)

Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.791769375+09:00" level=info msg="Graph migration to content-addressability took 0.00 seconds"
Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.793294500+09:00" level=warning msg="Your kernel does not support cgroup memory limit"
Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.793461875+09:00" level=warning msg="Unable to find cpu cgroup in mounts"
Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.793573000+09:00" level=warning msg="Unable to find blkio cgroup in mounts"
Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.794140625+09:00" level=warning msg="Unable to find cpuset cgroup in mounts"
Apr 26 16:05:22 armadillo dockerd[1933]: time="2017-04-26T16:05:22.794535500+09:00" level=warning msg="mountpoint for pids not found"
Apr 26 16:05:22 armadillo dockerd[1933]: Error starting daemon: Devices cgroup isn't mounted
Apr 26 16:05:22 armadillo systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 26 16:05:22 armadillo systemd[1]: Failed to start Docker Application Container Engine.
Apr 26 16:05:22 armadillo systemd[1]: Unit docker.service entered failed state.

3.
/etc/default/grubを編集すればよいという記事もありましたが、そもそもそういったファイルはありませんでした。

4.
デバイスcgroupがマウントされていないと表示されていますので下記のようにコマンドを打ってみましたが、これもうまくいきません。
root@armadillo:/home/atmark# sudo apt-get install cgroupfs-mount
Reading package lists... Done
Building dependency tree
Reading state information... Done
cgroupfs-mount is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up docker-ce (17.03.1~ce-0~debian-jessie) ...
insserv: Script ti-uim is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: Script ti-uim is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: Script ti-uim is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: Script ti-uim is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if empty.
insserv: Script ti-uim is broken: incomplete LSB comment.
insserv: missing `Required-Start:' entry: please add even if empty.
Job for docker.service failed. See 'systemctl status docker.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript docker, action "start" failed.
dpkg: error processing package docker-ce (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

なにかわかることはないでしょうか。
よろしくお願いいたします。

コメント

at_mizo

2017年5月1日 10時26分

溝渕です。

恐らくLinuxカーネルでコントロールグループ(cgroup)関連機能が有効化され
ていないのが原因です。

Linuxカーネルコンフィギュレーションで、必要なcgroupの機能を有効化して
みてください。

General setup --->
[*] Control Group support --->

ping94

2017年6月24日 15時40分

かなり遠回りした感はありますが、お教えいただいたとおりcgroup関連を有効にしてイメージファイルを作成したところ、Dockerをインストールすることができました。
バージョンを確認しましたら、下記のように返ってきたのでインストールはできていると思います。

root@armadillo:/home/atmark# docker --version
Docker version 17.03.1-ce, build c6d412e

その次に、Dockerの動作確認をしようと思い、

root@armadillo:/home/atmark# docker run hello-world

とコマンドを入力すると、"hello-world"と返ってくるはずですが、

docker: Error response from daemon: failed to create endpoint mystifying_brahmagupta on network bridge: failed to add the host (veth95c708d) <=> sandbox (vethbd40907) pair interfaces: operation not supported.

とエラーが返ってきました。

シリアルインターフェースやSSHで接続しているので、iptablesが邪魔しているのかとも思い下記のコマンドを打って無効にして見ましたが動作は同じでした。
(これが正しい分析なのか、このコマンドで正しいのかどうかもあまり自信がありません)

# iptables -P INPUT ACCEPT
# iptables -P OUTPUT ACCEPT
# iptables -F

間違っていることや、他にチェックする項目などはないでしょうか。
お手数をおかけいたしますが、よろしくお願いします。

> 溝渕です。
>
> 恐らくLinuxカーネルでコントロールグループ(cgroup)関連機能が有効化され
> ていないのが原因です。
>
> Linuxカーネルコンフィギュレーションで、必要なcgroupの機能を有効化して
> みてください。
>
>
> General setup --->
> [*] Control Group support --->
>
>

ping94

2017年6月27日 16時59分

ArmadilloでDockerを動かしたい件ですが、下記のページを見てシェルを実行し足りないモジュールをチェックしましたら、いろいろとmissingしているようです。
https://github.com/moby/moby/blob/master/contrib/check-config.sh

--実行結果--

Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
- CONFIG_CGROUP_CPUACCT: enabled
- CONFIG_CGROUP_DEVICE: enabled
- CONFIG_CGROUP_FREEZER: enabled
- CONFIG_CGROUP_SCHED: enabled
- CONFIG_CPUSETS: enabled
- CONFIG_MEMCG: enabled
- CONFIG_KEYS: enabled
- CONFIG_VETH: missing
- CONFIG_BRIDGE: enabled
- CONFIG_BRIDGE_NETFILTER: enabled
- CONFIG_NF_NAT_IPV4: enabled
- CONFIG_IP_NF_FILTER: enabled
- CONFIG_IP_NF_TARGET_MASQUERADE: enabled
- CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled
- CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled
- CONFIG_NETFILTER_XT_MATCH_IPVS: missing
- CONFIG_IP_NF_NAT: missing
- CONFIG_NF_NAT: enabled
- CONFIG_NF_NAT_NEEDED: enabled
- CONFIG_POSIX_MQUEUE: missing
- CONFIG_DEVPTS_MULTIPLE_INSTANCES: missing
 
Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: missing
- CONFIG_CGROUP_PIDS: missing
- CONFIG_MEMCG_SWAP: enabled
- CONFIG_MEMCG_SWAP_ENABLED: enabled
    (cgroup swap accounting is currently enabled)
- CONFIG_MEMCG_KMEM: enabled
- CONFIG_RESOURCE_COUNTERS: enabled
- CONFIG_BLK_CGROUP: enabled
- CONFIG_BLK_DEV_THROTTLING: missing
- CONFIG_IOSCHED_CFQ: enabled
- CONFIG_CFQ_GROUP_IOSCHED: missing
- CONFIG_CGROUP_PERF: enabled
- CONFIG_CGROUP_HUGETLB: missing
- CONFIG_NET_CLS_CGROUP: missing
- CONFIG_CGROUP_NET_PRIO: missing
- CONFIG_CFS_BANDWIDTH: missing
- CONFIG_FAIR_GROUP_SCHED: enabled
- CONFIG_RT_GROUP_SCHED: missing
- CONFIG_IP_VS: missing
- CONFIG_IP_VS_NFCT: missing
- CONFIG_IP_VS_RR: missing
- CONFIG_EXT3_FS: enabled
- CONFIG_EXT3_FS_XATTR: enabled
- CONFIG_EXT3_FS_POSIX_ACL: enabled
- CONFIG_EXT3_FS_SECURITY: enabled
- CONFIG_EXT4_FS: enabled
- CONFIG_EXT4_FS_POSIX_ACL: enabled
- CONFIG_EXT4_FS_SECURITY: enabled
- Network Drivers:
  - "overlay":
    - CONFIG_VXLAN: missing
      Optional (for encrypted networks):
      - CONFIG_CRYPTO: enabled
      - CONFIG_CRYPTO_AEAD: enabled
      - CONFIG_CRYPTO_GCM: enabled
      - CONFIG_CRYPTO_SEQIV: enabled
      - CONFIG_CRYPTO_GHASH: enabled
      - CONFIG_XFRM: enabled
      - CONFIG_XFRM_USER: enabled
      - CONFIG_XFRM_ALGO: enabled
      - CONFIG_INET_ESP: enabled
      - CONFIG_INET_XFRM_MODE_TRANSPORT: enabled
  - "ipvlan":
    - CONFIG_IPVLAN: missing
  - "macvlan":
    - CONFIG_MACVLAN: missing
    - CONFIG_DUMMY: missing
  - "ftp,tftp client in container":
    - CONFIG_NF_NAT_FTP: enabled
    - CONFIG_NF_CONNTRACK_FTP: enabled
    - CONFIG_NF_NAT_TFTP: enabled
    - CONFIG_NF_CONNTRACK_TFTP: enabled
- Storage Drivers:
  - "aufs":
    - CONFIG_AUFS_FS: missing
  - "btrfs":
    - CONFIG_BTRFS_FS: missing
    - CONFIG_BTRFS_FS_POSIX_ACL: missing
  - "devicemapper":
    - CONFIG_BLK_DEV_DM: missing
    - CONFIG_DM_THIN_PROVISIONING: missing
  - "overlay":
    - CONFIG_OVERLAY_FS: enabled
  - "zfs":
    - /dev/zfs: missing
    - zfs command: missing
    - zpool command: missing
 
Limits:
- /proc/sys/kernel/keys/root_maxkeys: 1000000

とりあえず報告のみですが、前途多難です。

at_yuma.arakawa

2017年7月28日 18時05分

荒川です。

dockerのインストール状態を確認させていただきたいのですが、
確認なのですが、以下のコマンドを実行するとどのように表示されますでしょうか。

・docker-ceパッケージのインストール状態を確認

[armadillo]# dpkg -l docker-ce

・dockerサービスの動作状態を確認

[armadillo]# systemctl -l status docker

また、
https://docs.docker.com/engine/installation/linux/debian/
こちらのページでは
- Debianのバージョン
- CPUのアーキテクチャ
によって分かれている手順があります。

- Debianのバージョン: Jessie
- CPUのアーキテクチャ: armhf
の手順を試しましたでしょうか。

armhfの場合動作確認のコマンドは

docker run armhf/hello-world

と上記のページで記載されています。

ping94

2017年7月29日 17時03分

コメントありがとうございます。

まず最初のコマンドを打つと、下記のようになりました。

root@armadillo:/home/atmark# dpkg -l docker-ce
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  docker-ce      17.06.0~ce-0 armhf        Docker: the open-source applicati

2番目のコマンドを打つと、下記のようになりました。

root@armadillo:/home/atmark# systemctl -l status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled)
   Active: active (running) since Thu 1970-01-01 09:00:16 JST; 47 years 6 months ago
     Docs: https://docs.docker.com
 Main PID: 463 (dockerd)
   CGroup: /system.slice/docker.service
           tq463 /usr/bin/dockerd -H fd://
           mq583 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
 
Jan 01 09:00:11 armadillo dockerd[463]: time="1970-01-01T09:00:11.238960500+09:00" level=warning msg="mountpoint for pids not found"
Jan 01 09:00:11 armadillo dockerd[463]: time="1970-01-01T09:00:11.250286000+09:00" level=info msg="Loading containers: start."
Jan 01 09:00:12 armadillo dockerd[463]: time="1970-01-01T09:00:12.978173500+09:00" level=warning msg="Running modprobe nf_nat failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.14.79-at14/modules.dep.bin'`, error: exit status 1"
Jan 01 09:00:12 armadillo dockerd[463]: time="1970-01-01T09:00:12.997143000+09:00" level=warning msg="Running modprobe xt_conntrack failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file '/lib/modules/3.14.79-at14/modules.dep.bin'`, error: exit status 1"
Jan 01 09:00:14 armadillo dockerd[463]: time="1970-01-01T09:00:14.649535875+09:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
Jan 01 09:00:15 armadillo dockerd[463]: time="1970-01-01T09:00:15.474434125+09:00" level=info msg="Loading containers: done."
Jan 01 09:00:15 armadillo dockerd[463]: time="1970-01-01T09:00:15.659920250+09:00" level=info msg="Daemon has completed initialization"
Jan 01 09:00:15 armadillo dockerd[463]: time="1970-01-01T09:00:15.660130375+09:00" level=info msg="Docker daemon" commit=02c1d87 graphdriver=overlay version=17.06.0-ce
Jan 01 09:00:16 armadillo dockerd[463]: time="1970-01-01T09:00:16.000465250+09:00" level=info msg="API listen on /var/run/docker.sock"
Jan 01 09:00:16 armadillo systemd[1]: Started Docker Application Container Engine.

またお教えいただいたページは見ておりまして、その内容通りに設定しました。
(英語と技術的理解の不足とではなはだ心許ないところではありますが)
確認コマンドでは下記の通りエラーになり、hello-worldが表示されません。

root@armadillo:/home/atmark# docker run armhf/hello-world
docker: Error response from daemon: failed to create endpoint nervous_payne on network bridge: failed to add the host (veth57bf0a6) <=> sandbox (veth7004610) pair interfaces: operation not supported.
ERRO[0000] error waiting for container: context canceled

よろしくお願いいたします。

at_yuma.arakawa

2017年8月4日 19時05分

荒川です。

コメントありがとうございます。
Docker-CEのインストール状態事態に問題はないことが確認できました。

また、当方で動作確認できました。

結果としては、2017/06/27 - 16:59 にコメントいただいた
"Generally Necessary:"で"missing"となっているものを有効化しただけです。

以下に、有効化の際のmenuconfig内の場所を記載します。

■ CONFIG_VETH

-> Device Drivers
  -> Network device support (NETDEVICES [=y])
    -> Network core driver support (NET_CORE [=y])
      -> Virtual ethernet pair device  <== 有効化

■ CONFIG_NETFILTER_XT_MATCH_IPVS

-> Networking support (NET [=y])
  -> Networking options
    -> Network packet filtering framework (Netfilter) (NETFILTER [=y])
      -> IP virtual server support  <== 有効化(*1)
      -> Core Netfilter Configuration
        -> Netfilter Xtables support (required for ip_tables) (NETFILTER_XTABLES [=y])
          -> "ipvs" match support  <== 有効化(*2)

(*1)を有効化すると(*2)が現れます。

■ CONFIG_POSIX_MQUEUE

-> General setup
  -> POSIX Message Queues  <== 有効化

■ CONFIG_DEVPTS_MULTIPLE_INSTANCES

-> Device Drivers
  -> Character devices
    -> Enable TTY (TTY [=y])
      -> Unix98 PTY support (UNIX98_PTYS [=y])
        -> Support multiple instances of devpts  <== 有効化

■ CONFIG_IP_NF_NAT
3.4のカーネルには存在しないコンフィギュレーションのため(*3)、有効化していません。
シンボル名に"NAT"や"MASQUERADE"と付くコンフィギュレーションは全てデフォルトで有効化されているので、
問題は無いかと思います。

(*3) 参考: CONFIG_IP_NF_NATが存在したLinuxカーネルバージョンについて
http://cateee.net/lkddb/web-lkddb/IP_NF_NAT.html

 

なお、menuconfigには検索機能がありますので、
シンボル名が分かれば、検索をすることでmenuconfig内の設定箇所を調べることができます。

使用方法は以下を参考にしてみてください。
- KMC Staff Blog:Linuxカーネルのmake menuconfigでの検索機能
http://blog.kmckk.com/archives/4078122.html

 

最後に、動作結果は以下の通りです。

root@armadillo:~# docker run armhf/hello-world
device vethcc9d9c9 entered promiscuous mode
IPv6: ADDRCONF(NETDEV_UP): vethcc9d9c9: link is not ready
IPVS: Creating netns size=784 id=3
IPv6: ADDRCONF(NETDEV_CHANGE): vethcc9d9c9: link becomes ready
docker0: port 1(vethcc9d9c9) entered forwarding state
docker0: port 1(vethcc9d9c9) entered forwarding state
 
Hello from Docker on armhf!
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.
 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 Hub account:
 https://hub.docker.com
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/
 
docker0: port 1(vethcc9d9c9) entered disabled state
device vethcc9d9c9 left promiscuous mode
docker0: port 1(vethcc9d9c9) entered disabled state
root@armadillo:~#

ping94

2017年9月2日 16時26分

溝渕様、荒川様、ありがとうございました。

いろいろと失敗したりしてかなり時間がかかってしまいましたが、下記のようにDockerインストールに成功したようです。

atmark@armadillo:~$ docker run armhf/hello-world
 
Hello from Docker on armhf!
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.
 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 Hub account:
 https://hub.docker.com
 
For more examples and ideas, visit:
 https://docs.docker.com/engine/userguide/

メモとして手順を書いておきます。

1.カーネルコンフィギュレーションを変更
  Armadilloマニュアル「20.1.イメージをカスタマイズする」を参照します。
 A.Control Group supportの設定
   どれを選択すればよいか判断できなかったのですべて設定しました。
 B.教えていただいた下記の項目を設定
  (1) CONFIG_VETHの設定
  (2) CONFIG_NETFILTER_XT_MATCH_IPVSの設定
  (3) CONFIG_POSIX_MQUEUEの設定
  (4) CONFIG_DEVPTS_MULTIPLE_INSTANCESの設定
  CONFIG_IP_NF_NATの設定についてはアドバイスいただいた通りなにも変更していません。
 C.カーネルコンフィギュレーションの確定
2.ビルドしてイメージファイル(Linux カーネルと DTB)が作成されていることを確認
3.「6.1.2. Linux カーネルイメージの更新」と「6.1.3. DTB の更新」を参照してファイルを更新。

なお、

atmark@armadillo:~$ docker run hello-world

は実行に失敗していますがarmhf版ではないので動作しないということなのでしょうね、おそらく。

こちらの知識不足で最初の質問から4か月以上かかってしまいましたが動作させることができました。
本当にありがとうございました。