I would like to try out ZFS on Ubuntu(16.04) docker container. Followed the following 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
Listing the ZFS mounts
>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
...
Wonder why I still get **Storage Driver: aufs & Root Dir: /var/lib/docker/aufs" in place of zfs?
Also how can I map "/zpool-docker" into the Ubuntu container image?
Setup Docker on Proxmox VE Using ZFS Storage. If you install Docker CE as normal, and Proxmox VE was setup with the installation on a ZFS rpool, then the system will fail to boot if you make a container using default settings. After installing Docker, we will see that it automatically selects the ZFS storage driver: # docker info | grep Storage.
Another concern is that the if you are installing on a boot device such as a SATA DOM you may want to change the Docker container storage directory to a zfs pool using the same procedure. What we need to do now is stop Docker and change the configuration to mount to a different location.
Use the ZFS storage driver. ZFS is a next generation filesystem that supports many advanced storage technologies such as volume management, snapshots, checksumming, compression and deduplication, replication and more.
To see what storage driver Docker is currently using, use docker info and look for the Storage Driver line: To change the storage driver, see the specific instructions for the new storage driver. Some drivers require additional configuration, including configuration to physical or logical disks on the Docker host.
Assuming you have:
data
)/var/lib/docker
(created with a command along the line of: zfs create -o mountpoint=/var/lib/docker data/docker
)Then:
Stop your docker daemon (eg. systemctl stop docker.service
)
Create a file /etc/docker/daemon.json
or amend it to contain a line with "storage-driver"
set to zfs
:
{
...
"storage-driver": "zfs"
...
}
Restart your docker daemon.
docker info
should now reveal:
Storage Driver: zfs
Zpool: data
Zpool Health: ONLINE
Parent Dataset: data/docker
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With