From 04bdbce90624610e251c67cb708968dc94d9aec4 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 23 May 2026 16:18:59 +1000 Subject: [PATCH] docs(docker): deprecation warning in entrypoint.sh shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #30136 review item O5: docker/entrypoint.sh is now a thin shim that forwards to stage2-hook.sh — the real ENTRYPOINT is /init plus main-wrapper.sh. External scripts that hard-coded entrypoint.sh as the container's ENTRYPOINT will see the cont-init bootstrap happen but the CMD will not be exec'd (because stage2-hook only handles bootstrap; main-wrapper.sh handles the CMD passthrough). Add a stderr warning explaining the new contract and pointing callers at the migration path (drop the --entrypoint override). The shim itself stays in place for one release cycle so the deprecation isn't a hard break — anyone still invoking it sees the warning in their logs and has time to migrate. --- docker/entrypoint.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b1b44d8abf0..9e735fe561b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -5,6 +5,23 @@ # but it's no longer the ENTRYPOINT — /init is. # # When called directly (e.g. by an old wrapper script that hard-coded -# docker/entrypoint.sh), forward to the stage2 hook for parity with the -# pre-s6 entrypoint behavior. +# docker/entrypoint.sh as the container ENTRYPOINT, or by an external +# orchestration script that invokes it inside the container), forward to +# the stage2 hook for parity with the pre-s6 entrypoint behavior. The +# stage2 hook only handles cont-init bootstrap (UID remap, chown, config +# seed, skills sync); it does NOT exec the CMD. Callers that depended +# on the pre-s6 contract "entrypoint.sh sets up state then execs hermes" +# will see the bootstrap happen but the CMD will not run from this shim. +# +# Deprecation: this shim is preserved for one release cycle to give +# downstream users time to migrate their wrappers to the image's real +# ENTRYPOINT (`/init`). It will be removed in a future major release. +# Surface a warning to stderr so anyone still invoking this path +# sees the migration notice in their logs. +echo "[hermes] WARNING: docker/entrypoint.sh is a deprecated shim under " \ + "s6-overlay. The container's real ENTRYPOINT is /init + " \ + "main-wrapper.sh; this script only runs the stage2 cont-init hook " \ + "and does NOT exec the CMD. If you hard-coded docker/entrypoint.sh " \ + "as your ENTRYPOINT, drop the override — docker will use the image's " \ + "default ENTRYPOINT (/init), which handles bootstrap AND CMD." >&2 exec /opt/hermes/docker/stage2-hook.sh "$@"