查看正在运行的Docker守护式容器
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
431dc327cd14 ubuntu:latest "/bin/bash -c 'while 22 minutes ago Up 22 minutes daemon_ubuntu
停止守护式容器
[root@localhost ~]# docker stop daemon_ubuntu
daemon_ubuntu
注:
docker stop命令向Docker容器进程发送SIGTERM信号。如果你想快速停止某个容器,也可以使用docker kill命令向容器进程发送SIGKILL信号
查看是否停止成功
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[root@localhost ~]# docker ps -n 1
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
431dc327cd14 ubuntu:latest "/bin/bash -c 'while 25 minutes ago Exited (-1) 2 minutes ago daemon_ubuntu
转载于:https://blog.51cto.com/ovcer/1596819