Skip to content

Fix docker-shim: only inject cache flags when builder available#1587

Closed
lukemarsden wants to merge 1 commit intomainfrom
fix/docker-shim-cache-flags
Closed

Fix docker-shim: only inject cache flags when builder available#1587
lukemarsden wants to merge 1 commit intomainfrom
fix/docker-shim-cache-flags

Conversation

@lukemarsden
Copy link
Collaborator

Summary

  • Docker-shim was unconditionally adding --cache-from/--cache-to flags to docker build commands
  • This caused "Cache export is not supported for the docker driver" errors when the shared BuildKit builder wasn't available
  • Now cache flags are only injected when the helix-shared buildx builder can be set up

Error before fix

🔨 Building helix-sway:latest...
[+] Building 0.0s (0/0)                                  docker:default
ERROR: failed to build: Cache export is not supported for the docker driver.

Changes

Modified injectBuildCacheFlags() to only add cache flags inside the if builderAvailable block, ensuring we never add cache flags without a builder that supports them.

🤖 Generated with Claude Code

The docker-shim was unconditionally adding --cache-from/--cache-to flags
to docker build commands, even when the shared BuildKit builder wasn't
available. This caused "Cache export is not supported for the docker
driver" errors when using the default docker driver.

Now cache flags are only injected when:
1. The shared helix-buildkit container is running
2. The helix-shared buildx builder can be created/found

Without a proper builder, builds proceed normally without cache injection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lukemarsden
Copy link
Collaborator Author

Wrong approach - should fail fast instead of silently skipping cache. Will fix properly.

@lukemarsden lukemarsden closed this Feb 5, 2026
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.

1 participant