docker info
systemctl stop docker
dd if=/dev/zero of=/virtual_disk.img bs=1M count=2048
losetup /dev/loop1 /virtual_disk.img
sudo apt-get install lvm2
pvcreate /dev/loop1
vgcreate docker /dev/loop1
lvcreate --wipesignatures y -n thinpool docker -l 95%VG
lvcreate --wipesignatures y -n thinpoolmeta docker -l 1%VG
lvconvert -y --zero n -c 512K --thinpool docker/thinpool --poolmetadata docker/thinpoolmeta
cat /etc/lvm/profile/docker-thinpool.profile
activation {
thin_pool_autoextend_threshold=80
thin_pool_autoextend_percent=20
}
lvchange --metadataprofile docker-thinpool docker/thinpool
lvs -o+seg_monitor
mkdir /var/lib/docker.bk
mv /var/lib/docker/* /var/lib/docker.bk
cat /etc/docker/daemon.json
{
"storage-driver": "devicemapper",
"storage-opts": [
"dm.thinpooldev=/dev/mapper/docker-thinpool",
"dm.use_deferred_removal=true",
"dm.use_deferred_deletion=true"
]
}
systemctl daemon-reload
systemctl start docker
docker info