Skip to content

Instantly share code, notes, and snippets.

@scott-fleischman
Last active January 26, 2017 22:03
Show Gist options
  • Save scott-fleischman/c5e5437fb158f68cba32b44e4cdf2226 to your computer and use it in GitHub Desktop.
Save scott-fleischman/c5e5437fb158f68cba32b44e4cdf2226 to your computer and use it in GitHub Desktop.
Docker Cheatsheet

Docker Cheatsheet

sudo docker ps to see running containers

sudo docker ps -a to see running and stopped containers

sudo docker images to see the images you have

sudo docker stop <id container> to stop container

sudo docker start <id container> to restart a container

sudo docker rm <id container> to remove container

sudo docker rmi <id image> to remove image

sudo docker rm $(sudo docker ps -a -q -f "status=exited") to remove all exited containers

sudo docker stop $(sudo docker ps -a -q -f "status=running") to stop all running containers

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