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

Likes(0)

Comment list count 0 Comments

No Comments

WeChat Self-Service

WeChat Consult

TaoBao

support@elephdev.com

发表
评论
Go
Top