From 19f76a340709075421d51dbbbf641d543c42a3c6 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sat, 21 Nov 2026 00:29:29 -0800 Subject: [PATCH] Reword the `docker-init` comment to explain why it's needed The zombie `containerd-shim` behavior is by design (the shim is deliberately orphaned so it can outlive containerd, and relies on PID 1 to reap it), so `docker-init` is the correct fix rather than a workaround. --- 29/dind/dockerd-entrypoint.sh | 2 +- dockerd-entrypoint.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/29/dind/dockerd-entrypoint.sh b/29/dind/dockerd-entrypoint.sh index 130883d69..14dac8ce6 100755 --- a/29/dind/dockerd-entrypoint.sh +++ b/29/dind/dockerd-entrypoint.sh @@ -144,7 +144,7 @@ if [ "$1" = 'dockerd' ]; then # explicitly remove Docker's default PID file to ensure that it can start properly if it was stopped uncleanly (and thus didn't clean up the PID file) find /run /var/run -iname 'docker*.pid' -delete || : - # XXX inject "docker-init" (tini) as pid1 to workaround https://github.com/docker-library/docker/issues/318 (zombie container-shim processes) + # containerd-shim is orphaned by design (so that it can outlive containerd) and relies on PID 1 to reap it, so we need a real init ("docker-init" is tini) or every container leaves a zombie "containerd-shim" behind -- https://github.com/docker-library/docker/issues/318#issuecomment-7059930088 set -- docker-init -- "$@" iptablesLegacy= diff --git a/dockerd-entrypoint.sh b/dockerd-entrypoint.sh index 130883d69..14dac8ce6 100755 --- a/dockerd-entrypoint.sh +++ b/dockerd-entrypoint.sh @@ -144,7 +144,7 @@ if [ "$1" = 'dockerd' ]; then # explicitly remove Docker's default PID file to ensure that it can start properly if it was stopped uncleanly (and thus didn't clean up the PID file) find /run /var/run -iname 'docker*.pid' -delete || : - # XXX inject "docker-init" (tini) as pid1 to workaround https://github.com/docker-library/docker/issues/318 (zombie container-shim processes) + # containerd-shim is orphaned by design (so that it can outlive containerd) and relies on PID 1 to reap it, so we need a real init ("docker-init" is tini) or every container leaves a zombie "containerd-shim" behind -- https://github.com/docker-library/docker/issues/318#issuecomment-7059930088 set -- docker-init -- "$@" iptablesLegacy=