EN
Docker - stop all containers
4 points
In this short article we would like to show how to stop all run containers in Docker.
Quick solution (run following command):
xxxxxxxxxx
1
docker stop $(docker ps -aq)
Output:
xxxxxxxxxx
1
d76423e8e259
2
f44b6ffcee6a
3
25605bf8dc3f
4
c14692b929b2
5
8867d0ac1ed1
6
252ab6485893
We can iterate over all ids and send TERM signal.
xxxxxxxxxx
1
for i in $(docker ps -q); do docker kill $i; done;