Languages
[Edit]
EN

Docker - stop all containers

4 points
Created by:
Kate_C
23510

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;

 

Docker - useful wiki posts

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join