Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Comments on How to identify which Docker container an overlay is for?

Post

How to identify which Docker container an overlay is for?

+1
−0

Docker stores data under directories like /var/lib/docker/overlay2/xyz123. These sometimes grow very large, and Docker does not provide good instructions for how to easily manage the space used by these. I assume IDs like xyz123 somehow correspond to containers.

Occasionally, I notice that one of these is very large, eg. 10 GB. If all I know is the path of the overlay dir, how can I figure out which container this was for, so I can decide if it's something that I can clean up?

Note: When this point is brought up, it often conjures long arguments about whether it's bad to mess with these overlay dirs manually. I'm not asking about deleting them manually in this question, so let's not get into that here. I am only asking how to identify which container/image is responsible for a given overlay directory.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Pruning (2 comments)
Pruning
Iizuki‭ wrote 8 days ago

Have you looked at docker system prune? I have a scheduled a run with --force --all --filter "until=720h" options, which clears stuff after one month.

matthewsnyder‭ wrote 8 days ago

This was after pruning, but with your additional argument for one month, it did delete the 10 GB directory. Thank you! I would still like to find out which container caused the 10 GB, so that I can prevent the issue in the future as well.