Skip to content

Instantly share code, notes, and snippets.

@jackofallops
Created September 18, 2018 07:28
Show Gist options
  • Save jackofallops/b1405b07b3d0b120aa35d40614d14b68 to your computer and use it in GitHub Desktop.
Save jackofallops/b1405b07b3d0b120aa35d40614d14b68 to your computer and use it in GitHub Desktop.
Docker cli cheatsheet (basic)
# Show running containers
docker ps
# show running and stopped containers
docker ps -a
# show container logs, -f option follows logs like "tail"
docker logs [-f] [container ID or name]
# stop a container
docker stop [container ID or name]
# start a stopped container
docker start [container ID or name]
# remove a stopped container
docker rm [container ID or name]
# List local images
docker images
# remove a local image
docker rmi [image ID or name:label]
# clean up temp docker files, images, layers, cache etc
docker system prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment