Skip to content

Instantly share code, notes, and snippets.

@cinhtau
Last active October 8, 2022 14:49
Show Gist options
  • Save cinhtau/b30dba162d2942c5a90366ef3fa97c97 to your computer and use it in GitHub Desktop.
Save cinhtau/b30dba162d2942c5a90366ef3fa97c97 to your computer and use it in GitHub Desktop.
Docker Commands

View

Old way

docker ps

New consistent approach

# list containers
docker container ls
# list images
docker image ls
# list networks
docker network ls
# list volumes
docker volume ls

Stop

Stop all running containers

docker stop $(docker ps)

Cleanup

Cleanup containers ≥ v1.13+

docker container prune

Cleanup whole system (network, volumes, etc.)

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