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 ubuntu_bash
Show lsof of a container :
lsof -U | grep containerid


2019-05-13 16:23:57


Add a Comment

Login or Register to post a Comment.