Skip to content

Instantly share code, notes, and snippets.

@guilhermelinhares
Last active July 26, 2023 17:06
Show Gist options
  • Save guilhermelinhares/749f6cea338200be154577d56555e460 to your computer and use it in GitHub Desktop.
Save guilhermelinhares/749f6cea338200be154577d56555e460 to your computer and use it in GitHub Desktop.
Docker Command

Commands Docker

Remove and stop all containers

docker ps -aq | xargs docker stop | xargs docker rm

Remove all images

docker rmi $(docker images -a -q)

Prune images none

docker rmi $(docker images --filter "dangling=true" -q --no-trunc)

List and show the IDs of stopped containers

 docker ps --filter "status=exited" --filter "status=dead" -q

Removing all stopped containers

docker rm $(docker ps --filter "status=exited" --filter "status=dead" -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment