Solution to the problem that docker cannot pull: 1. Check your "docker root dir" when the docker service is on; 2. Close the docker service; 3. Create a new "root dir path"; 4. Edit " daemon.json", add ""graph":"/docker/data""; 5. Execute "systemctl daemon-reload"; 6. Restart the docker service.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
What should I do if docker cannot pull?
docker pull image failed: ERROR: failed to register layer: no space left on device
docker pull failed: ERROR: failed to register layer: /usr/local/openjdk- 11/lib/module: no space left on device
It is simply too difficult. Docker pulls the tomcat image. When I pull the image for the first time, it prompts me no space left.... There is not enough space. I have already expanded the virtual machine. , and I haven’t installed any images, just no space. Speechless. I searched a lot of solutions online, and many of them talked about modifying the root dir of docker. I tried three methods according to the Internet, but the modification was not successful. In the end, it’s not that the online methods are wrong, it’s that they don’t suit me. Because I configured the accelerator in the /etc/docker/daemon.json file. Here's my solution. I installed centos 7 system.
1. When the docker service is on, check your own docker root dir and enter
docker info
to find the Docker Root Dir: /var/lib/docker. Mine was this address before modification.
Exit, press the esc button, enter: wq, and press Enter to exit
2. Then close the docker service
systemctl stop docker.service
3. Create a new one that you want to modify root dir path. If you already have the target address, you don’t need to create a new one.
Mine is /xws/docker/images
mkdir -p /xws/docker/images
4. Edit /etc/docker/daemon.json and add "graph": " /docker/data”
vim /etc/docker/daemon.json
{ "graph": "/xws/docker/images" }
For me, the most important step is this! If the image accelerator is configured in /etc/docker/daemon.json, it needs to be modified to the following format:
{ "registry-mirrors":["https://xxxxx.mirror.aliyuncs.com"],"graph": "/usr/xws/docker/images" }
My modification was unsuccessful at that time, so I modified it like this: The following is an error demonstration:
{ "registry-mirrors":["https://xxxxx.mirror.aliyuncs.com"] } { "graph": "/xws/docker/images" }
5. Exit editing, and then execute
systemctl daemon-reload
6. Restart the docker service
systemctl restart docker.service
7. Finally, confirm whether the modification is successful
docker info | grep Dir
My modification was successful La~
#I pulled the tomcat image successfully! Happy
There is another problem. Linux always reminds me that there is insufficient disk space in the root directory of the file system. I don’t dare to delete things randomly. After looking for information, I found that I can caches are deleted. If you encounter it, you can try it. Just click on the message that pops up to view it. Follow the red message that the memory is full to find the cache and delete it.
Recommended learning: "docker video tutorial"
The above is the detailed content of What should I do if docker cannot pull?. For more information, please follow other related articles on the PHP Chinese website!