The tool Docker Kill is a command that performs the function of killing a specific container in Docker that is running. The syntax of this command allows its operation within the container platform, being this: $docker container kill [OPTIONS] CONTAINER [CONTAINER…].
One of the features of Docker Kill command the thing is arises from a base Docker command called docker container command, which is responsible for fulfilling the functions focused on the management, administration and handling of containers and which has other subcommands (such as docker ps, docker stop either docker container lsamong others) that allow different actions to be carried out within the platform containers.
It should be noted that the Docker Kill command can not only send a kill signal kill to a container, but also has the ability to send a custom type signal to one or more user-specified Docker containers.
Docker Kill Command Options
The Docker Kill tool has an option that allows you to extend its operation. This option is called –signalalthough it can also be executed under the format or abbreviation -s, and refers to the signal sent by the command to the container to indicate its completion.
This signal can refer to a certain container through options such as its ID, its name or its identification prefix. Besides, the –signal It can be a signal name in the SIG
It is important to note that although the preset signal of this command (i.e. SIGKILL) is intended to terminate the container, the signal indicated through the option –signal may not turn out to be terminaldepending on which container’s parent process you want to kill.
Docker Kill vs Docker Stop
Although this command may be similar to the Docker Stop commandwe must clarify that the docker stop command It has the task of stopping one or more running containers, for which it first sends the SIGTERM signal to the process to inform it of its completion, which then allows it to close its connections, files, and so on. Furthermore, in the event that the container does not stop within ten seconds of sending this signal and executing the command, Docker Stop will kill the container.
On the contrary, Docker Kill performs this task immediately, sending the SIGKILL signalwhich cannot be managed through a signal controller and is responsible for causing a shutdown of the process that was being carried out inside the container.
What is the next step?
In this article you have learned what the Docker Kill command is, as well as what its main characteristics, functions and options are; now, don’t hesitate continue your training process to master this and other essential tools in the sector. To do this, we recommend you sign up for our DevOps & Cloud Computing Full Stack Bootcampwhere in less than 6 months you will learn everything necessary to become an expert in the IT sector and obtain a competitive advantage. Take the next step and sign up for our boot camp to continue learning!