Skip to content

Instantly share code, notes, and snippets.

@rkaneko
Last active December 20, 2018 13:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkaneko/a256f9cdacb47d538f77c8ea23c3dcf8 to your computer and use it in GitHub Desktop.
Save rkaneko/a256f9cdacb47d538f77c8ea23c3dcf8 to your computer and use it in GitHub Desktop.
Docker disk trouble shooting

Case: No space left on device error

# remove unnecessary images
docker rm $(docker ps -q -f 'status=exited')
docker rmi $(docker images -q -f "dangling=true")

Case: Volumes are full

# display volumes
$ sudo find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <(docker ps -aq | xargs docker inspect | jq -r '.[]|.Mounts|.[]|.Name|select(.)')

# delete volume
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment