启动已停止的容器、停止运行的容器、重启容器
参见:https://www.runoob.com/docker/docker-start-stop-restart-command.html
停止所有正在运行的容器
sudo docker stop $(sudo docker ps -q)
或
docker stop $(docker ps -q)
docker ps -q命令是列出所有正在运行的容器id,根据这些id停止运行容器
参见:https://www.runoob.com/docker/docker-start-stop-restart-command.html
sudo docker stop $(sudo docker ps -q)
或
docker stop $(docker ps -q)
docker ps -q命令是列出所有正在运行的容器id,根据这些id停止运行容器