Docker ZFS Storage
Centos Docker Storage Using ZFS
Set Config
vim /etc/sysconfig/docker-storage
DOCKER_STORAGE_OPTIONS='--storage-driver=zfs'vim /etc/sysconfig/docker
OPTIONS='--graph=/local/docker'mkdir -p /local/docker
zfs create -o mountpoint=/local/docker tank/docker
Start And Test ZFS Snapshot
systemctl start docker
docker pull busybox
docker run --name=lmy -it busybox /bin/sh
docker ps -l
zfs snap -r tank/docker@xxx
rm -rf /local/docker
zfs rollback -r tank/docker@xxx
systemctl restart docker
docker start -i lmy
Issues
pull 不下来image
`mkdir -p /etc/systemd/system/docker.service.d/;
echo "[Service]" > http-proxy.conf;
echo Environment="HTTP_PROXY=http:<your proxy ip>/" > http-proxy.conf`/etc/sysconfig/docker中--graph参数, 即docker的root目录不能是默认的/var/lib/docker
否则zfs rollback 之后restart 会失败, 目前还不知道原因.zfs rollback 之后必须先restart docker, 如果直接start container会报错.