Skip to content

Remove unsupported cacheTo export from devcontainer prebuild workflow#119

Merged
coder3101 merged 2 commits into
mainfrom
copilot/fix-github-actions-job
May 7, 2026
Merged

Remove unsupported cacheTo export from devcontainer prebuild workflow#119
coder3101 merged 2 commits into
mainfrom
copilot/fix-github-actions-job

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

The Pre-build Dev Container workflow fails on GitHub-hosted runners because devcontainers/ci@v0.3 is configured to export build cache (cacheTo) using a Docker driver that does not support cache export in this environment. This PR removes that unsupported export path while preserving existing image push gating behavior.

  • Root issue addressed

    • Stop passing cacheTo to devcontainers/ci in .github/workflows/prebuild_devcontainer.yml, eliminating the docker buildx ... --cache-to ... failure mode.
  • Behavior intentionally preserved

    • Keep imageName, cacheFrom, push: filter, refFilterForPush, and eventFilterForPush unchanged.
    • Workflow still builds and pushes under the same branch/event filters as before.
  • Scope

    • Single-line workflow config change; no changes to .devcontainer/devcontainer.json or application code.
-      cacheTo: ghcr.io/${{ github.repository }}/devcontainer
Original prompt

Fix the failing GitHub Actions job in repository coder3101/protols.

Context:

Observed failure from the job logs:

  • The workflow invokes devcontainers/ci@v0.3 and the underlying build command includes docker buildx build --load --cache-to ghcr.io/coder3101/protols/devcontainer ...
  • Docker fails with: ERROR: failed to build: Cache export is not supported for the docker driver. Switch to a different driver, or turn on the containerd image store, and try again.

Likely root cause:

  • The workflow is configured with cacheTo: ghcr.io/${{ github.repository }}/devcontainer, which causes the action to request cache export on a driver that does not support it in this environment.

Requested fix:

  • Update the workflow so the devcontainer prebuild job succeeds on GitHub-hosted runners.
  • Prefer the minimal, low-risk change.
  • Remove or adjust the unsupported cache export configuration in .github/workflows/prebuild_devcontainer.yml.
  • It is acceptable to remove cacheTo entirely. If appropriate, keep cacheFrom only if it remains supported and useful.

Acceptance criteria:

  • The workflow no longer attempts an unsupported cache export configuration.
  • The prebuild devcontainer workflow remains able to build and push the image under the existing push: filter, refFilterForPush, and eventFilterForPush behavior.
  • Keep the change narrowly scoped to fixing this CI failure.

Please create a pull request with the fix.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.

Assistant: The failure is caused by the workflow exporting build cache with a Docker Buildx driver that does not support it.

Root cause

In the job logs, the failing command is:

docker buildx build --load --cache-to ghcr.io/coder3101/protols/devcontainer ...

and Docker reports:

ERROR: failed to build: Cache export is not supported for the docker driver.

That lines up with the workflow configuration in .github/workflows/prebuild_devcontainer.yml, specifically:

- name: Pre-build and push
  uses: devcontainers/ci@v0.3
  with:
    imageName: ghcr.io/${{ github.repository }}/devcontainer
    cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
    cacheTo: ghcr.io/${{ github.repository }}/devcontainer
    push: filter
    refFilterForPush: refs/heads/main
    eventFilterForPush: push, workflow_dispatch

The problematic setting is cacheTo. With the current runner/build setup, that cache export mode is unsupported.

Solution

Remove cacheTo from the workflow. If needed, you can also remove cacheFrom, but cacheTo is the direct cause of the failure.

Suggested patch

Update .github/workflows/prebuild_devcontainer.yml to:

- name: Pre-build and push
  uses: devcontainers/ci@v0.3
  with:
    imageName: ghcr.io/${{ github.repository }}/devcontainer
    push: filter
    refFilterForPush: refs/heads/main
    eventFilterForPush: push, workflow_dispatch

Optional conservative version

If you want to keep trying to pull cache but stop exporting it:

- name: Pre-build and push
  uses: devcontainers/ci@v0.3
  with:
    imageName: ghcr.io/${{ github.repository }}/devcontainer
    cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
    push: filter
    refFilterForPush: refs/heads/main
    eventFilterForPush: push, workflow_dispatch

Why this should fix it

The devcontainer definition at .devcontainer/devcontainer.json is not the source of this failure. The build fails before any issue in that file matters. The error is entirely in the workflow’s cache export configuration.

Recommended change

Use this minimal edit:

      - name: Pre-build and push
        uses: devcontainers/ci@v0.3
        with:
          imageName: ghcr.io/${{ github.repository }}/devcontainer
-         cacheFrom: ghcr.io/${{ github.repository }}/devcontainer
-         cacheTo: ghcr.io/${{ github.repository }}/devcontainer
          push: filter
          refFilterForPush: refs/heads/main
          eventFilterForPush: push, workflow_dispatch
...

</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

Copilot AI changed the title [WIP] Fix failing GitHub Actions job in protols repository Remove unsupported cacheTo export from devcontainer prebuild workflow May 7, 2026
Copilot AI requested a review from coder3101 May 7, 2026 12:38
@coder3101 coder3101 marked this pull request as ready for review May 7, 2026 12:44
@coder3101 coder3101 merged commit b68439e into main May 7, 2026
1 check passed
@coder3101 coder3101 deleted the copilot/fix-github-actions-job branch May 7, 2026 12:44
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