I’m having the same problem.
In Docker for Mac, the problem is that there’s a maximum size (about 60gb) for this file: ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
. This is where all images, containers, and volumes are stored.
The pg_restore
is filling that up.
I don’t know that there’s a fix for this.
There’s this workaround, where you create a replacement Docker.qcow2
file that is allowed to grow larger, but it doesn’t really seem like a good permanent fix: No space left on device error
Here are some relevant links:
- https://forums.docker.com/t/no-space-left-on-device-error/10894
- https://forums.docker.com/t/consistently-out-of-disk-space-in-docker-beta/9438
-
https://github.com/docker/for-mac/issues/371 discusses the fact that the
Docker.qcow2
file doesn’t shrink as its contents is removed (which isn’t directly related to your issue, but does add to it)
You might also be able to work around this by mounting a host directory (e.g. with -v /path/to/some/host/folder:/var/lib/postgresql/data
). This would not store your data in a docker volume, which would keep it from increasing the size of that Docker.qcow2 file. This comes with some extremely poor performance, though, which is discussed here.
I’ve also asked how people get around this issue on StackOverflow.