Skip to content

Instantly share code, notes, and snippets.

@jspenc72
Last active November 16, 2018 21:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jspenc72/de19aa78eccf585dbc01906e1889b324 to your computer and use it in GitHub Desktop.
Save jspenc72/de19aa78eccf585dbc01906e1889b324 to your computer and use it in GitHub Desktop.
Docker Cheat Sheet

Docker Commands

To ssh into container:

docker exec -it <container id> /bin/bash

Remove all old images:

docker rmi $(docker images | grep "^<none>" | awk '{print $3}')

Remove all old containers:

docker rm `docker ps --no-trunc -aq`

Stop all running containers

docker stop $(docker ps -aq)

Remove any dangling volumes

docker volume rm $(docker volume ls -qf dangling=true)

Cleanup System

docker system prune -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment