1.docker stop介绍
docker stop命令是用来停止一个运行中的docker容器。
2.docker stop用法
docker stop [参数] container [container......]
[root@centos79 ~]# docker stop --help
Usage: docker stop [OPTIONS] CONTAINER [CONTAINER...]
Stop one or more running containers
Aliases:
docker container stop, docker stop
Options:
-s, --signal string Signal to send to the container
-t, --time int Seconds to wait before killing the container
[root@centos79 ~]#
3.实例
3.1.停止已经运行的docker容器
命令:
docker stop Container_Id
[root@centos79 ~]# docker ps -a |grep -i 20ce
20cebbe3fac3 daocloud.io/library/centos:latest "/bin/bash" 2 days ago Up 10 minutes centos-ztj
[root@centos79 ~]# docker stop 20ce
20ce
[root@centos79 ~]# docker ps -a |grep -i 20ce
20cebbe3fac3 daocloud.io/library/centos:latest "/bin/bash" 2 days ago Exited (0) 2 seconds ago centos-ztj
[root@centos79 ~]#