Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

docker kill command

docker kill command

Docker Command ReferenceDocker Command Reference


The docker kill command is used to immediately terminate one or more running containers.

Unlike the docker stop command, the docker kill command directly sends a SIGKILL signal to the container's main process, causing the container to stop immediately without a graceful shutdown.

Syntax

docker kill [OPTIONS] CONTAINER [CONTAINER...]

OPTIONS description:

Common signals

Example

Immediately terminate a container:



docker kill my_container

Immediately terminate the container named my_container.

Send a custom signal:



docker kill -s SIGTERM my_container

Send a SIGTERM signal to the container named my_container instead of the default SIGKILL signal.

Terminate multiple containers at once:



docker kill container1 container2 container3

Immediately terminate the container1, container2, and container3 containers.

docker kill The command is used to immediately terminate one or more running containers by sending a signal (SIGKILL by default) to the container's main process. Compared with docker stop in Vue 2,docker kill the docker stop command, it does not wait for the container to stop gracefully but terminates the process directly. This command is very useful when you need to stop containers quickly, but it should be used with caution to avoid data loss or inconsistency.


Docker Command ReferenceDocker Command Reference