Home > Operation and Maintenance > Docker > What should I do if docker cannot pull?

What should I do if docker cannot pull?

藏色散人
Release: 2022-10-21 14:36:02
Original
6289 people have browsed it

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.

What should I do if docker cannot pull?

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
Copy after login

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
Copy after login

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
Copy after login

4. Edit /etc/docker/daemon.json and add "graph": " /docker/data”

vim /etc/docker/daemon.json
Copy after login
{
 "graph": "/xws/docker/images"
}
Copy after login

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"
}
Copy after login

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"
}
Copy after login

5. Exit editing, and then execute

systemctl daemon-reload
Copy after login

6. Restart the docker service

systemctl restart docker.service
Copy after login

7. Finally, confirm whether the modification is successful

docker info | grep Dir
Copy after login

My modification was successful La~

What should I do if docker cannot pull?

#I pulled the tomcat image successfully! Happy

What should I do if docker cannot pull?

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template