From c3bdb2af37f44cbf8b455c3992b9849a6eba3a6e Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 27 May 2026 16:21:05 +1000 Subject: [PATCH] ci(docker): add shellcheck shell=sh directive to main-wrapper.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shellcheck doesn't recognize the s6-overlay `#!/command/with-contenv sh` shebang and aborts with SC1008 ("This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh/'busybox sh'. Add a 'shell' directive to specify."). The error fires at --severity=error too, so it fails the "Docker / shell lint" CI job on every PR that touches docker/. Add the canonical `# shellcheck shell=sh` directive — same fix already applied to the sibling cont-init.d scripts (`02-reconcile-profiles` and `015-supervise-perms`) when they adopted the with-contenv shebang. The shebang was changed from `#!/bin/sh` → `#!/command/with-contenv sh` in PR #32412 (commit 29c71e9) to fix env-propagation through s6's PID 1. The shellcheck-directive line was missed in that PR; this patches it. Reproduces locally: docker run --rm -v "$PWD:/mnt" -w /mnt koalaman/shellcheck:stable \ --severity=error --format=gcc docker/main-wrapper.sh Before: docker/main-wrapper.sh:1:1: error: [SC1008] (rc=1) After: (no output) (rc=0) Script behavior is unchanged — the directive is a comment, and `sh -n` / `bash -n` parse the file cleanly either way. --- docker/main-wrapper.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/main-wrapper.sh b/docker/main-wrapper.sh index 3426c7a0953..a164b77eaa2 100755 --- a/docker/main-wrapper.sh +++ b/docker/main-wrapper.sh @@ -1,4 +1,5 @@ #!/command/with-contenv sh +# shellcheck shell=sh # /opt/hermes/docker/main-wrapper.sh — wraps the container's CMD with # the same argument-routing logic the pre-s6 entrypoint.sh used. Runs # as /init's "main program" (Docker CMD) so it inherits stdin/stdout/