Restarting all running containers in docker


Sometimes we may want to restart all running contains with one single command. Which will be very handy especially when we have more containers also you don't have to form the command dynamically with the current container id.

Following is the command to restart all running docker containers

docker restart $(docker ps -q)