滿天的星座2017-04-25 09:05:29
It does not have to be an independent partition, you can also modify this line by using --graph
参数来指定存储路径。
或者使用systemd
来管理服务, 就在docker.service
at startup:
ExecStart=/usr/bin/dockerd --graph=/path/to/docker/dir -H fd://
Execute after restartingsudo docker info | grep "Root Dir"
, you can see that the root path has changed.
高洛峰2017-04-25 09:05:29
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.