I'm running a Mac-native Docker (no virtualbox/docker-machine).
I have a huge image with a lot of infrastructure in it (Postgres, etc.). I have run cleanup scripts to get rid of a lot of cruft--unused images and so forth.
When I run my image I get an error like:
could not create directory "/var/lib/postgresql/data/pg_xlog": No space left on device
On my host Mac /var is sitting at 60% space available and generally my disk has lots of storage free.
Is this some Docker configuration I need to bump up to give it more resources?
Relevant lines from mount
inside docker:
none on / type aufs (rw,relatime,si=5b19fc7476f7db86,dio,dirperm1) /dev/vda1 on /data type ext4 (rw,relatime,data=ordered) /dev/vda1 on /etc/resolv.conf type ext4 (rw,relatime,data=ordered) /dev/vda1 on /etc/hostname type ext4 (rw,relatime,data=ordered) /dev/vda1 on /etc/hosts type ext4 (rw,relatime,data=ordered) /dev/vda1 on /var/lib/postgresql/data type ext4 (rw,relatime,data=ordered)
Here’s df
:
[11:14] Filesystem 1K-blocks Used Available Use% Mounted on none 202054928 4333016 187269304 3% / tmpfs 1022788 0 1022788 0% /dev tmpfs 1022788 0 1022788 0% /sys/fs/cgroup /dev/vda1 202054928 4333016 187269304 3% /data shm 65536 4 65532 1% /dev/shm tmpfs 204560 284 204276 1% /run/docker.sock
A stopped container's writable layers still take up disk space. To clean this up, you can use the docker container prune command. By default, you are prompted to continue. To bypass the prompt, use the -f or --force flag.
If a container is using an unexpected amount of either type of memory, it runs out of memory without affecting other containers or the host machine. Within this setting, if the kernel memory limit is lower than the user memory limit, running out of kernel memory causes the container to experience an OOM error.
eventually this guide helped me to resize/expand my docker volume. 2 - Shut down your VM, open VM Settings > Hard Disk(s) > change size of your 'virtual_disk. vmdk' (or whatever is your machine's virtual disk), then click Apply (see this guide).
I haven't found many options for this, the main issue in github is https://github.com/docker/for-mac/issues/371
Some of the options suggested there are:
docker rm $(docker ps -a -q) docker rmi $(docker images -q) docker volume rm $(docker volume ls |awk '{print $2}') rm -rf ~/Library/Containers/com.docker.docker/Data/*
docker system prune
qemu
using homebrew and move the image around, see this specific comment: https://github.com/docker/for-mac/issues/371#issuecomment-242047368 but you need to have at least 2x of space left to do this without losing containers/images.See also: How do you get around the size limitation of Docker.qcow2 in the Docker for Mac? And https://forums.docker.com/t/no-space-left-on-device-error/10894/26
I ran into the same issue, running docker system prune --volumes
resolved the problem.
"Volumes are not pruned by default, and you must specify the --volumes flag for docker system prune to prune volumes."
See: https://docs.docker.com/config/pruning/#prune-everything
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With