Skip to content

Instantly share code, notes, and snippets.

@apoclyps
Created June 6, 2019 08:27
Show Gist options
  • Save apoclyps/fd9ba75be2faf021b0a728e4225e50d1 to your computer and use it in GitHub Desktop.
Save apoclyps/fd9ba75be2faf021b0a728e4225e50d1 to your computer and use it in GitHub Desktop.

Useful Docker Commands

kill all running containers with

docker kill $(docker ps -q)

delete all stopped containers with

docker rm $(docker ps -a -q)

delete all images with

docker rmi $(docker images -q)

delete all unused & unnamed images

docker rmi -f $(docker images -f "dangling=true" -q)

Remove all containers with status=exited

docker rm $(docker ps -q -f status=exited)

Stop all containers (will run stop only for active)

docker stop $(docker ps -q)

Stop all containers (will run stop only for all)


docker stop $(docker ps -aq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment