After the server where Docker is located has been running for a while, it was found that the server disk directory was running out of space. By checking the directories level by level through du -h --max-depth=1 /, it is found that the files in the /var/lib/docker directory are too large. Use the following method to solve this problem. Transfer data to modify docker default storage location There are several ways to modify the default storage location of Docker. - Stop the docker service systemctl stop docker - Create a new docker directory, execute the command df -h, and find a large disk I created the /data/docker/lib directory under the /data directory mkdir -p /data/docker/lib - Migrate the files under /var/lib/docker directory to /data/docker/lib Completed docker path after migration: /data/docker/lib/docker rsync -avz /var/lib/docker/ /data/docker/lib/ - Configure /usr/lib/systemd/system/docker.service vi /usr/lib/systemd/system/docker.service [Service] ExecStart=/usr/bin/dockerd --graph=/data/docker/lib/docker - Restart Docker systemctl daemon-reload systemctl restart docker systemctl enable docker - Confirm whether the Docker Root Dir modification has taken effect [root@iZbp1jcwx7sfb1yrnvpg84Z docker]# docker info ... Docker Root Dir: /data/docker/lib/docker Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ ... - After the startup is successful, confirm whether the previous image is still there [root@iZbp1jcwx7sfb1yrnvpg84Z docker]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE 10.80.177.233/policy 2.1.2 64ac4e178cd2 2 hours ago 818 MB 10.80.177.233/crm 2.1.3 d7636fbb7a29 2 hours ago 762 MB - After confirming that the container is OK, delete the files in the /var/lib/docker/ directory This is the end of this article about solving the problem of insufficient docker disk space. For more relevant content about insufficient docker disk space, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Steps and pitfalls of upgrading linux mysql5.5 to mysql5.7
>>: CSS3 transition to achieve underline example code
Question: In index.html, iframe introduces son.htm...
Problem Description Today, when I was modifying t...
In the front-end layout process, it is relatively...
Table of contents 1. v-bind: can bind some data t...
Copy code The code is as follows: <meta name=&...
This article example shares the specific code of ...
When users install MySQL database for the first t...
Table of contents Docker version Install Docker E...
Table of contents 1. Scene introduction 2 Code Op...
Two days ago, I took advantage of the Double 11 s...
Table of contents Achieve results Implementation ...
1. View existing modules /usr/local/nginx/sbin/ng...
Table of contents vue2.x vue3.x tiny-emitter plug...
I will explain the installation of MySQL under Wi...
Table of contents 1. Import files 2. HTML page 3....