4-Docker命令之docker kill

1.docker kill介绍

docker kill命令是用来杀掉一个或多个正在运行中的容器。

2.docker kill用法

docker kill [参数] container [container......]

[root@centos79 ~]# docker kill --help

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

Kill one or more running containers

Aliases:
  docker container kill, docker kill

Options:
  -s, --signal string   Signal to send to the container
[root@centos79 ~]# 

3.实例

3.1.基于container id杀掉运行中的容器

命令:

docker kill 20ce

[root@centos79 ~]# docker ps -a | grep 20ce
20cebbe3fac3   daocloud.io/library/centos:latest   "/bin/bash"               3 days ago    Up 11 minutes                                                                                          centos-ztj
[root@centos79 ~]# docker kill 20ce
20ce
[root@centos79 ~]# docker ps -a | grep 20ce
20cebbe3fac3   daocloud.io/library/centos:latest   "/bin/bash"               3 days ago

你可能感兴趣的:(docker,docker,容器,运维)