Skip to content

Instantly share code, notes, and snippets.

@shmaltorhbooks
Created November 30, 2018 10:15
Show Gist options
  • Save shmaltorhbooks/8036bb3c02396ac07740f3f3e1d92817 to your computer and use it in GitHub Desktop.
Save shmaltorhbooks/8036bb3c02396ac07740f3f3e1d92817 to your computer and use it in GitHub Desktop.
docker cache
# cleans all dangling images. This is useful for removing intermediate images left over from multiple builds
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
# for removing stopped containers
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
# This would kill and remove all images in your cache
docker kill $(docker ps -q)
docker_clean_ps
docker rmi $(docker images -a -q)
docker system prune -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment