Skip to content

ci: Work around Compose's external Dockerfile permission error - #1330

Open
Christof Marti (chrmarti) wants to merge 2 commits into
mainfrom
ci/compose-entitlement-fix
Open

Christof Marti (chrmarti) wants to merge 2 commits into
mainfrom
ci/compose-entitlement-fix

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a shared composite action containing a behavioral probe and conditional source build/install. Each affected workflow gains only one setup-action invocation, with no extra jobs, artifact transfers, permissions, or test-branch triggers.
  • Probe the installed Compose with an external Dockerfile containing only FROM scratch and a label. No image downloads or containers are needed. If it builds successfully, keep the installed Compose.
  • Build the fixed Compose only when the probe fails with the specific --allow=fs.read error naming its Dockerfile. Other failures retain their exit status and fail setup explicitly.
  • Build exact upstream commit 1e1c577eab08ceb5ff0fcf4d8e3cbbc08a34ef35 from fix(bake): grant permissions for configured build inputs docker/compose#14325, verify the checkout, and install it as 5.6.0-dev.1e1c577 to preserve CLI capability detection. Rerun the same probe after installation to verify the actual behavior.
  • Clean up the temporary probe files and any successfully created probe image, including failure paths.
  • No GitHub API/token dependency or guessed release threshold. Keep Buildx and filesystem entitlement enforcement unchanged. Backports and development builds are tested by behavior.

Related to #1320; addresses the CI failures observed on #1329 without including that PR's dependency update. This is a CI workaround, not a runtime fix for CLI users.

Validation

  • npm run compile and npm run precommit passed.
  • YAML validation and all embedded Bash syntax checks passed.
  • 12 local probe/install/cleanup scenarios passed: already-working Compose, matching permission failure, unrelated errors, missing Compose, build/install failures, post-install verification, and cleanup failures.
  • The minimal probe reproduced the bug locally on Compose 5.5.1 / Buildx 0.37.2 in 0.52 seconds.
  • Probe-based CI passed: Linux PR matrix, Docker 29, and push CI. Logs confirm the probe reproduced the exact permission error, installed the source fix, rebuilt successfully, and removed the probe image. All PR checks are green.

Follow-up

Runners with working Compose skip the source build automatically. Remove this workaround once all affected runners ship fixed Compose.

Move Compose detection and source installation into a shared composite action. Check the installed version tag for docker/compose#14325, keeping fixed versions and the known source build unchanged. Preserve Buildx security enforcement and limit each existing workflow to one setup action.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace GitHub API version checks with a scratch build. Install the pinned source fix only for the matching fs.read failure, verify it with the same probe, and clean up the temporary files and image. Preserve unexpected failures instead of treating them as the Compose bug.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved findings remain, and the reported CI validation confirms successful workflow integration.

No open issues 🎉

What changed in this PR

Adds a CI-only workaround for Compose’s external-Dockerfile permission bug without changing CLI runtime behavior or disabling filesystem checks.

Changes:

  • Adds a behavioral probe that installs pinned Compose source only for the specific permission failure.
  • Verifies the replacement and cleans up probe resources.
  • Integrates the shared action into both affected workflows.
File Description
.github/​workflows/​test-docker-v29.yml Runs Compose setup after Docker 29 installation.
.github/​workflows/​dev-containers.yml Runs Compose setup after Docker configuration.
.github/​actions/​setup-compose/​action.yml Implements probing, conditional installation, verification, and cleanup.

Review effort: Balanced

@chrmarti
Christof Marti (chrmarti) marked this pull request as ready for review October 19, 2026 15:08
@chrmarti
Christof Marti (chrmarti) requested a review from a team as a code owner October 19, 2026 15:08
@chrmarti Christof Marti (chrmarti) changed the title ci: Install fixed Compose from source only when needed ci: Work around Compose's external Dockerfile permission error Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants