Skip to content

Instantly share code, notes, and snippets.

@ragul28
Created January 11, 2020 09:01
Show Gist options
  • Save ragul28/47edb96f0f6945aa2905559701a53966 to your computer and use it in GitHub Desktop.
Save ragul28/47edb96f0f6945aa2905559701a53966 to your computer and use it in GitHub Desktop.
Docker Cleanup commands

Docker Cleanup Commands

  • images cleanup
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
  • image cleanup based on name
docker rmi $(docker images | grep "asia.gcr.io" | awk '{print $3}')
  • cleanup container
 docker kill $(docker ps -q) 
 docker rm $(docker ps -aq)
 docker rm $(docker ps -aq --no-trunc --filter "status=exited")
  • system prune
docker system prune
  • system prune with volume
docker system prune --volume
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment