[cc]
修改Docker默认存储位置的方法一
/usr/lib/systemd/system/docker.service
/usr/lib/systemd/system/docker.service
–graph=/data/docker –storage-driver=overlay
ExecStart=/usr/bin/dockerd
/usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd –graph=/data/docker –storage-driver=overlay2
vi /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd
改为
ExecStart=/usr/bin/dockerd –graph=/data/docker –storage-driver=overlay2
reload配置文件
systemctl daemon-reload
重启docker
systemctl restart docker
修改Docker默认存储位置的方法二
cat /etc/docker/daemon.json
{
“storage-driver”: “overlay2”,
“storage-opts”: [ “overlay2.override_kernel_check=true” ],
“registry-mirrors”: [“https://4ux5p520.mirror.aliyuncs.com”],
“insecure-registries”:[“harbor.io”, “k8s.gcr.io”, “gcr.io”, “quay.io”],
“exec-opts”: [“native.cgroupdriver=systemd”],
“data-root”: “/data/docker”,
“log-driver”: “json-file”,
“log-opts”: {
“max-size”: “100m”
}
}
reload配置文件
systemctl daemon-reload
重启docker
systemctl restart docker
[/cc]
插入文章:
插入商品: