Postgre “no space left on device”

Hi everybody.

I have a system build with a docker compose that creates different containers, and one of this runs the posgresql alpine db. The problem i’m facing right now is that the container with the db cannot start because, from the logs, it seems that there’s no space left.
I’d like to make space without destroying and rebuilding the containers, instead i wanted to inspect what’s inside the db to manually remove the unused data.
Is there a way to do so?

Thank you.

It depends on how you use Docker. Do you have Docker Engine or Docker Desktop? In this case I am almost sure you have Docker Engine as Docker Desktop would have different error I think.

You can use this command to get the path of the folder of the container:

docker container inspect portainer --format '{{ json .GraphDriver.Data.MergedDir }}'

Then you can go to that folder and read the files if you want to, but I normally would not write anything in the docker data root directly.

Did you store data on the container’s filesystem? You should always use a volume. or mount the files from the host.

You should check what you can remove from the docker data root that you don’t actually need. You could have left-over volumes, docker images, build cache.

Hi, thank you for the answer.
I am using Docker Engine. I did manage to create some space on the disk and restart the container, then I used

docker prune 

to remove whatever was unused.
I already use a volume to store data.

Then what did you mean by “db” in the following quote?

The docker data root which is usually /var/lib/docker ?