Docker Community Forums

Share and learn in the Docker community.

How to check the amount of Disk space within a container?

I’m trying to get the amount of Disk Space from a program that is running within a Docker container. I suspect that Docker is starting containers small and resizing as it goes or something because in spite of it having 90GB available, it only believes it actually has 20GB.

Another possibility is that we are running multiple containers that communicate with each other. Perhaps they are sharing and claiming ownership of empty disk space? So this container believes it only has 20GB available? Except we’re running a dozen containers, so not splitting equally.

Is there a way to do this within Docker? Would be nice to have Docker set some environment variable that contain the right info or have some library we can call or something.