Docker start stop restart all containers

Restart all running containers :
docker restart $(docker ps -q)
docker restart $(docker ps -a -q)
Stop all running containers :
docker stop $(docker ps -q)
docker stop $(docker ps -a -q)
Restart all containers :
docker restart $(docker ps -a)
To start only stopped containers :
docker start $(docker ps -a -q -f status=exited)
Bash into the container :
docker exec -it container /bin/bash
docker exec -it container /bin/sh
Show lsof of a container :
lsof -U | grep containerid


2020-10-16 13:34:51


Add a Comment

Login or Register to post a Comment.