st123
st123

Reputation: 264

"no space left on device" -when running docker-compose on ubuntu machine. doesn't help to clean and restart

*docker system prune doesn't work!!!!

i keep getting the following error:

ERROR: write /var/lib/docker/tmp/GetImageBlob892028471: no space left on device

my docker info:

Filesystem     Inodes IUsed IFree IUse% Mounted on
udev             119K   308  119K    1% /dev
tmpfs            123K   505  122K    1% /run
/dev/xvda1      1000K  137K  864K   14% /
tmpfs            123K     1  123K    1% /dev/shm
tmpfs            123K     3  123K    1% /run/lock
tmpfs            123K    18  123K    1% /sys/fs/cgroup
/dev/loop0        474   474     0  100% /snap/snapd/11588
/dev/loop1         16    16     0  100% /snap/amazon-ssm-agent/3552
/dev/loop2        11K   11K     0  100% /snap/core18/1997
/dev/loop3        474   474     0  100% /snap/snapd/12704
/dev/loop4        11K   11K     0  100% /snap/core18/2074
/dev/loop5         16    16     0  100% /snap/amazon-ssm-agent/4046
tmpfs            123K    11  123K    1% /run/user/1000

I wanted to change the path of docker-storage as it was recommended somewhere but the path /etc/sysconfig/ doesn't exist and that's where the file is meant to me. Could also be that I have taken up too much space in the ubuntu machine and need help clearing it out.

Upvotes: 0

Views: 771

Answers (2)

ti7
ti7

Reputation: 18886

I ended up creating a very heavy-handed function for this; note that it will burninate all your containers and their vnets!

docker_cleanup() {
  set -x
  echo "pruning containers"
  docker container prune -f
  # https://stackoverflow.com/a/42371013/
  docker system prune -f
  set +x
}

Upvotes: 0

NorNor
NorNor

Reputation: 141

It can happen that a process that was not killed gracefully is holding onto a large amount of disk space and it is not reported in df a reboot will force the process to let go of the disk space allowing you to utilise the space again.

Upvotes: 1

Related Questions