Back to TIL
March 2025
posted on 03.17.2025

How to Stop All Docker Containers

docker kill $(docker ps -q)
  • docker ps: Lists all running containers. -q only return the container IDs.
  • docker kill: Stops the continers by container ID.

Remove all containers

docker rm $(docker ps -a -q)
  • docker ps -a -q: Lists all containers (including non-running) and only return their IDs.
  • docker rm: Remove containers by their ID.

Remove all images

docker rmi $(docker images -q)
  • docker images -q: Lists all images by their IDs.
  • docker rmi: Removes docker images by their ID.
No reactions yet

2026.10.01 14:01:34 in Naperville, IL
Last visitor from Mitaka, Japan
Theme
Color theme
⌘K