'Docker overlay2 disk usage

I have a problem with overlay2 disk usage

When I executing df -h, I have 222G used disk space: Filesystem Size Used Avail Use% Mounted on /dev/mapper/docker-docker 264G 222G 43G 85% /docker

When I executing du -shc *, in /docker directory, I have 36G used disk space: 17G containers 14M image 256K network 19G overlay2 0 plugins 0 swarm 0 tmp 0 trust 32K volumes 36G total Why such difference in used disk space?

PS if I restart docker, disk space freed up

PSS I don't have 'Exited' containers, and unused images/volume



Solution 1:[1]

du command somehow counts space multiple times. I think it depends on fact that each docker directory is a separate mount. For analyzing disk space you can use docker system df command.

Please read documentation about.

Also, you can read this discussion about analyzing disk space.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ozlevka