Languages
[Edit]
EN

Docker - stop all containers

4 points
Created by:
Kate_C
2952

In this short article we would like to show how to stop all run containers in Docker.

Quick solution (run following command):

docker stop $(docker ps -aq)

Output:

d76423e8e259
f44b6ffcee6a
25605bf8dc3f
c14692b929b2
8867d0ac1ed1
252ab6485893

Alternative solutions

We can iterate over all ids and send TERM signal.

for i in $(docker ps -q); do docker kill $i; done;

 

Hey 👋
Would you like to know what we do?
  • Dirask is online IT community for professionals and hobbyist to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.