Is it safe to clean docker/overlay2/

I got some docker containers running on AWS EC2, the /var/lib/docker/overlay2 folder grows very fast in disk size.

I’m wondering if it is safe to delete its content?
or if docker has some kind of command to free up some disk usage.


UPDATE:

I actually tried docker system prune -a already, which reclaimed 0Kb.

Also my /docker/overlay2 disk size is much larger than the output from docker system df

After reading docker documentation and BMitch’s answer, I believe it is a stupid idea to touch this folder and I will try other ways to reclaim my disk space.

18 Answers
18

Leave a Comment