2019/2/7:こちらに最新の対応方法を記述しました。
https://qiita.com/tabimoba/items/e14ad812a148afc10b13
はじめに
Dockerの仕様変更により、LXDコンテナ上にDocker 18.09にインストールしてDockerを起動しようとすると、Dockerサービスが立ち上がらないという問題が発生しています。
現象
LXDコンテナ上でdockerサービスを起動しようとすると、サービスの起動に失敗します。
journalctl -xe
を実行すると、以下のログが出力されます。
Nov 27 07:05:23 *********** modprobe[2576]: modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-1072-aws/modules.dep.bin'
Nov 27 07:05:23 *********** modprobe[2576]: modprobe: FATAL: Module overlay not found in directory /lib/modules/4.4.0-1072-aws
対応方法
/lib/systemd/system/containerd.service
ファイルを次の通り変更してから、systemctl start docker
を実行すると、現象が解消されます。(ExecStartPreをコメントアウトします。)
/lib/systemd/system/containerd.service
[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target
[Service]
# ExecStartPre=/sbin/modprobe overlay
ExecStart=/usr/bin/containerd
KillMode=process
Delegate=yes
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
上記対応でとりあえず問題なく動いています。問題がある場合は追って記載します。
参考
- Containerd Issue - Can't start Docker service
- https://discuss.linuxcontainers.org/t/ubuntu-18-04-18-09-0-docker-on-lxd-3-0-2-3-6-is-broken/3202/2https://www.reddit.com/r/Crostini/comments/9z4dam/containerd_issue_cant_start_docker_service/
- ExecStartPre=/sbin/modprobe fails inside LXC
- https://github.com/containerd/containerd/issues/2772
- 18.09: containerd depends on overlay
- https://github.com/docker/for-linux/issues/475