Skip to content

Instantly share code, notes, and snippets.

@cander
Created August 8, 2017 21:19
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 cander/6878184e14867068bdd7652018984143 to your computer and use it in GitHub Desktop.
Save cander/6878184e14867068bdd7652018984143 to your computer and use it in GitHub Desktop.
Docker Cheat Sheet

Docker Cheat Sheet

All of these assume you're running as root. If not, preface them with sudo as needed.

List of Dangling Images

docker images --filter 'dangling=true' 

To remove them:

docker images -q --filter 'dangling=true' | xargs docker rmi

List of Containers that Exited

docker ps -a -f status=exited

To remove them:

docker ps -a -q -f status=exited | xargs docker rm

Cleaning up the dangling images might be useful - see above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment