Modify the default storage path of Docker

When Docker is installed by default, the /var/lib/docker/ directory will be used as the storage directory to store the pulled images and created containers, etc.

Modification method

  1. Create a storage folder
mkdir -p /data/docker
  1. Edit the /etc/docker/daemon.json file
{
   "data-root": "/data/docker"
}
  1. Restart Docker
systemctl daemon-reload
systemctl restart docker
  1. Check if the change is successful
docker info

image.png

点赞(0)

评论列表 共有 0 评论

暂无评论

微信服务号

微信客服

淘宝店铺

support@elephdev.com

发表
评论
Go
顶部