修改docker存储驱动

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_20817327/article/details/83383702
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

 

 

展开阅读全文

没有更多推荐了,返回首页