Docker ZFS Storage

I would like to try ZFS on the Ubuntu docker container (16.04). Followed by https://docs.docker.com/engine/userguide/storagedriver/zfs-driver/

> lsmod | grep zfs
zfs                  2813952  5
zunicode              331776  1 zfs
zcommon                57344  1 zfs
znvpair                90112  2 zfs,zcommon
spl                   102400  3 zfs,zcommon,znvpair
zavl                   16384  1 zfs

ZFS mount list

>sudo zfs list
NAME                  USED  AVAIL  REFER  MOUNTPOINT
zpool-docker          261K   976M  53.5K  /zpool-docker
zpool-docker/docker   120K   976M   120K  /var/lib/docker

After starting docker

> sudo docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.0
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: zfs
 Dirs: 0
 ...

I wonder why I still get ** Storage driver: aufs and Root Dir: / var / lib / docker / aufs instead of zfs?

Also, how can I map "/ zpool-docker" to an image of an Ubuntu container?

+4
source share
1 answer

Assuming you have:

  • ZFS pool (call him data)
  • ZFS dataset, set on /var/lib/docker(created by using the command line: zfs create -o mountpoint=/var/lib/docker data/docker)

Then:

(, systemctl stop docker.service)

/etc/docker/daemon.json , "storage-driver", zfs:

{
...
        "storage-driver": "zfs"
...
}

.

docker info :

Storage Driver: zfs
Zpool: data
Zpool Health: ONLINE
Parent Dataset: data/docker
+5

Source: https://habr.com/ru/post/1652267/


All Articles