Command for restarting all running docker containers?
Just run
docker restart $(docker ps -q)
Update
For Docker 1.13.1
use docker restart $(docker ps -a -q)
as in answer lower.
If you have docker-compose
, all you need to do is:
docker-compose restart
And you get nice print out of the container's name along with its status of the restart (done/error)
Here is the official guide for installing: https://docs.docker.com/compose/install/