美文网首页
docker17.06.2-ce命令3(docker stop)

docker17.06.2-ce命令3(docker stop)

作者: CUFFS | 来源:发表于2017-10-13 11:32 被阅读8次

查看docker stop 帮助

[root@localhost ~]# docker stop --help

Usage:  docker stop [OPTIONS] CONTAINER [CONTAINER...]

Stop one or more running containers #可以一次性停止一个或者多个容器

Options:
      --help       Print usage
  -t, --time int   Seconds to wait for stop before killing it (default 10) #等待几秒停止容器,默认是10秒
[root@localhost ~]# 

docker stop 容器

[root@localhost ~]# docker stop seafile
seafile
[root@localhost ~]# docker ps |grep seafile
[root@localhost ~]# docker ps -a|grep seafile
0375d08222b6        local_seafile/server:latest   "/sbin/my_init -- ..."   3 days ago          Exited (2) 19 seconds ago                                                                            seafile
[root@localhost ~]# 

docker stop -t 20

等待20秒停止容器,感觉不太理解有待研究,用途暂时没有发现

[root@localhost ~]# date
2017年 10月 13日 星期五 11:27:34 CST
[root@localhost ~]# docker stop seafile
seafile
[root@localhost ~]# docker ps -a|grep seafile
0375d08222b6        local_seafile/server:latest   "/sbin/my_init -- ..."   3 days ago          Exited (2) 3 seconds ago                                                                            seafile
[root@localhost ~]# date
2017年 10月 13日 星期五 11:27:47 CST
[root@localhost ~]# 

相关文章

网友评论

      本文标题:docker17.06.2-ce命令3(docker stop)

      本文链接:https://www.haomeiwen.com/subject/idczyxtx.html