We have docker-ce
running on some Ubuntu 16.04 LTS machines. The machines have a fast SSD for the OS, and a ZFS array for heavy data like docker containers.
Every time I'm brought in to fix the docker setup, it appears that an update reset the configuration to use the ZFS array for it's data.
That's probably because most guides are quite old. My changes, inspired by this article, are like so:
In /lib/systemd/system/docker.service
, add -g "/mnt/var/lib/docker"
like so:
ExecStart=/usr/bin/dockerd -g "/mnt/var/lib/docker" -H fd://
Also postpone the start of the service until the ZFS array is online:
[Unit]
After=network.target docker.socket firewalld.service zfs-mount.service
Even though this appears to be the recommended way to add a different directory according to the docs and old articles, this must be outdated because this file is reset on every update, and I have to manually change them back. After restarting the service, it works fine until the next update.