It does not have to be an independent partition, you can also modify this line by using --graph参数来指定存储路径。 或者使用systemd来管理服务, 就在docker.service at startup:
The main problem is not the image, but the running container uses this directory by default. Therefore, if there are log files written inside the container, or other production running data will affect the /var/lib/docker directory. Therefore, the production environment needs:
1. Regularly clean up useless images 2. Regularly clean out launched containers 3. /var/lib/docker Make independent directory partitions, preferably using SSD disks 4. The method provided by the system above is also good.
On production servers yes.
It does not have to be an independent partition, you can also modify this line by using
--graph
参数来指定存储路径。或者使用
systemd
来管理服务, 就在docker.service
at startup:Execute after restarting
sudo docker info | grep "Root Dir"
, you can see that the root path has changed.The main problem is not the image, but the running container uses this directory by default. Therefore, if there are log files written inside the container, or other production running data will affect the
/var/lib/docker
directory. Therefore, the production environment needs:1. Regularly clean up useless images
2. Regularly clean out launched containers
3.
/var/lib/docker
Make independent directory partitions, preferably using SSD disks4. The method provided by the system above is also good.