You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the docdocker kill command may be used to issue non-terminating signals to processes running inside containers. I.e. it's a regular practice for daemons to handle SIGHUP signal to reload its configuration. Another example is Java applications which dump their stack traces on SIGQUIT.
When a container is signalled with non-terminating signal with docker kill or docker-compose kill it continues to run and no indication is given that the container is a subject for termination (i.e. via docker inspect command). However if the container has restart policy set to unless-stopped it's no longer started after host system reboot (be it either soft or hard one).
Also there is no any indication in logs or in output of docker inspect why it has not started on boot. The exit code may differ depending on kind of reboot/reset happened though.
Reproduce
$ docker run --detach --restart unless-stopped nginx
a8d12aff922b44a0500c43c1aa4881184d4bb0331299805efb8fe265b5dbb998
$ docker kill --signal HUP a8d12aff922b44a0500c43c1aa4881184d4bb0331299805efb8fe265b5dbb998
a8d12aff922b44a0500c43c1aa4881184d4bb0331299805efb8fe265b5dbb998
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a8d12aff922b nginx "/docker-entrypoint.…" 11 seconds ago Up 10 seconds 80/tcp nice_proskuriakova
$ reboot # or reset the machine
...
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a8d12aff922b nginx "/docker-entrypoint.…" 14 minutes ago Exited (0) 13 seconds ago nice_proskuriakova
Expected behavior
docker kill should not affect restarts of the container on reboot
Initially observed on docker 24.0.5 from Ubuntu distribution packages. We bumped into this in the production. It was especially annoying because issuing non-terminating kills to containers to inspect them and reboots/resets were spaced out in time and there were no any hints provided by docker about the reasons containers were failed to restart.
The text was updated successfully, but these errors were encountered:
Description
According to the doc
docker kill
command may be used to issue non-terminating signals to processes running inside containers. I.e. it's a regular practice for daemons to handleSIGHUP
signal to reload its configuration. Another example is Java applications which dump their stack traces onSIGQUIT
.When a container is signalled with non-terminating signal with
docker kill
ordocker-compose kill
it continues to run and no indication is given that the container is a subject for termination (i.e. viadocker inspect
command). However if the container has restart policy set tounless-stopped
it's no longer started after host system reboot (be it either soft or hard one).Also there is no any indication in logs or in output of
docker inspect
why it has not started on boot. The exit code may differ depending on kind of reboot/reset happened though.Reproduce
Expected behavior
docker kill should not affect restarts of the container on reboot
docker version
Client: Docker Engine - Community Version: 26.1.1 API version: 1.45 Go version: go1.21.9 Git commit: 4cf5afa Built: Tue Apr 30 11:47:54 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 26.1.1 API version: 1.45 (minimum version 1.24) Go version: go1.21.9 Git commit: ac2de55 Built: Tue Apr 30 11:47:54 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.31 GitCommit: e377cd56a71523140ca6ae87e30244719194a521 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
Initially observed on docker 24.0.5 from Ubuntu distribution packages. We bumped into this in the production. It was especially annoying because issuing non-terminating kills to containers to inspect them and reboots/resets were spaced out in time and there were no any hints provided by docker about the reasons containers were failed to restart.
The text was updated successfully, but these errors were encountered: