ci(docker): fix Argument list too long when signing bake outputs#283
Merged
chopratejas merged 1 commit intomainfrom Apr 27, 2026
Merged
ci(docker): fix Argument list too long when signing bake outputs#283chopratejas merged 1 commit intomainfrom
chopratejas merged 1 commit intomainfrom
Conversation
The cosign signing step passed bake metadata via env var:
env:
BAKE_META: ${{ steps.bake.outputs.metadata }}
run: echo "$BAKE_META" | jq ...
For large bake targets (code-nonroot, runtime-code-nonroot) the
metadata JSON is large enough that combined argv+env at bash spawn
exceeds Linux ARG_MAX (~128 KiB on ubuntu-latest), so bash dies with
E2BIG before the script even runs.
Switch to writing metadata into a heredoc-backed temp file, then read
it via jq file input. Heredocs put the JSON in the script body itself,
which bash reads from a temp file (no ARG_MAX limit), bypassing the
env-size ceiling entirely.
Module: .github/workflows/docker.yml
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publish-docker / docker-variant-tagswas failing for thecode-nonrootandruntime-code-nonrootbake targets withArgument list too long.BAKE_META: \${{ steps.bake.outputs.metadata }}was passed as an env var. For those large variants the JSON metadata pushes combined argv+env past Linux ARG_MAX (~128 KiB on ubuntu-latest), so bash dies with E2BIG before the script body can run.\${RUNNER_TEMP}/bake_meta.jsonvia a single-quoted heredoc and feed it tojqfrom disk. Heredoc bodies live in the script (read by bash from a temp file), so they don't count against env size.Failing run
Test plan
make ci-precheck(commitlint, ruff, mypy, pytest, cargo fmt/clippy/test) green locally before pushpublish-docker / docker-variant-tagsmatrix succeeds for all 8 variants — includingcode-nonrootandruntime-code-nonroot\${REGISTRY}/\${image}-signaturesas before; verify by checking package version listing on GHCR after merge