Use the shellcheck image that has a shell in it

koalaman/shellcheck:stable is built FROM scratch with shellcheck as the
entrypoint and no /bin/sh, so the runner cannot start a job script in it
and the job fails with an OCI runtime error before shellcheck ever runs.
The -alpine variant is the same tool with a shell around it.
This commit is contained in:
2026-09-20 20:21:17 -07:00
parent 0f17cd6622
commit 45be9ca79f
+6 -5
View File
@@ -10,11 +10,12 @@ stages: [lint]
shellcheck: shellcheck:
stage: lint stage: lint
image: # The -alpine variant, not koalaman/shellcheck:stable. That one is built
name: koalaman/shellcheck:stable@sha256:bb596a0d169b85ddd81d8b6d3a2ff6d5baf5fca10b97f575ebc647c3dff62b3d # stable # FROM scratch with shellcheck as the entrypoint and no shell at all, so the
# The image's entrypoint is shellcheck itself, which would swallow the # runner cannot start a job script in it and the job dies before it runs
# runner's shell; GitLab needs a shell to drive the job. # ("OCI runtime create failed"). Clearing the entrypoint does not help: there
entrypoint: [""] # is still no /bin/sh to clear it to.
image: koalaman/shellcheck-alpine:stable@sha256:c82fe42504fbc9fc68f15d36638e5ee2324ebb8b94e96a3c4e395bf361c49183 # stable
script: script:
- | - |
files=$(find . -name '*.sh' -not -path './.git/*' | sort) files=$(find . -name '*.sh' -not -path './.git/*' | sort)