Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that Docker container causes insufficient disk space and cannot be accessed?

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Today Xiaobian to share with you Docker container caused by insufficient disk space can not access how to solve the relevant knowledge points, detailed content, clear logic, I believe most people still know too much about this knowledge, so share this article for everyone to refer to, I hope you read this article after some harvest, let's learn about it together.

Question:

Customer feedback said that system operation, there is a problem, query data error, I first thought of Redis is not hung up, resulting in some existing data query failure, later check the service is normal, so I want to enter the container project to check the log, the result entered the container exception error

1. Enter the running container directory

Enter the command to enter the container directory

docker exec -it container id bash

Error message:

failed to create runc console socket: mkdir /tmp/pty984695674: no space left on device: unknown

View disk details

df -h

Disk space is 100% used

It can be seen that Docker directory takes up a lot of space, we should delete Docker running logs to free up some storage space, so as to enter the running container directory to view error messages.

2. View container configuration information

We need to know the location of the container on the host, because we have no way to enter the container to delete the data

View container configuration information on the host

docker inspect container id

View host log path

Go to the command through cd log path and view file size through ls -lh command

You can see that the file is 23 gigabytes long and we need to stop the container before deleting it.

//stop container docker stop container id

3. delete log files

Delete log files by command

rm -rf delete file name

View disk space after deleting completion log

And you can see that there's room, and at this point we can go into the container and do something about it.

4. normal entry container docker exec -it container id bash

We're ready to go into the container. We're ready for canvassing.

The above is "Docker container caused by insufficient disk space can not be accessed how to solve" all the content of this article, thank you for reading! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report