LoginSignup
0
0

More than 5 years have passed since last update.

systemd-nspawnの中でDockerを動かす

Posted at

systemd-nspawn Advent Calendar 2017 24日目の記事です。

dockerhubからコンテナイメージを取ってくるのにDockerを入れたい場合があります。
コンテナ内でDockerを走らせる場合の話です

そのまま起動するとこんな感じのエラーとなるので

12月 17 22:04:59 test-ubuntu dockerd[111]: time="2017-12-17T22:04:59.587312884+09:00" level=info msg="libcontainerd: new containerd process, pid: 137"
12月 17 22:05:00 test-ubuntu dockerd[111]: time="2017-12-17T22:05:00.649577431+09:00" level=error msg="'overlay2' is not supported over btrfs"
12月 17 22:05:00 test-ubuntu dockerd[111]: time="2017-12-17T22:05:00.649621350+09:00" level=error msg="[graphdriver] prior storage driver overlay2 failed: backing file system is unsupported
12月 17 22:05:00 test-ubuntu dockerd[111]: Error starting daemon: error initializing graphdriver: backing file system is unsupported for this graph driver

/etc/systemd/system/docker.serviceのオプションを変更してストレージドライバにbtrfsを使うようにします

ExecStart=/usr/bin/dockerd -H fd:// $DOCKER_OPTS --storage-driver=btrfs

これで起動できますが、runは出来ないのでこんな感じで、イメージを抜き出しています

docker export $(docker create debian:latest) > debian.tar
0
0
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
0
0