Skip to content

Instantly share code, notes, and snippets.

@salaros
Last active December 20, 2018 09:11
Show Gist options
  • Save salaros/2eca5083e9e4ad9315e100c649081268 to your computer and use it in GitHub Desktop.
Save salaros/2eca5083e9e4ad9315e100c649081268 to your computer and use it in GitHub Desktop.
Clean up Docker images, containers etc
# Just clean up incomplete images
[[ ! -z $(docker images --filter "dangling=true" -q --no-trunc) ]] && \
docker rmi --force $(docker images --filter "dangling=true" -q --no-trunc)
#Remove unused containers
[[ ! -z $(docker ps -qa --no-trunc --filter "status=exited") ]] && \
docker rm $(docker ps -qa --no-trunc --filter "status=exited")
# Remove all the images
docker system prune -a -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment