Skip to content

fix(builder): use buildctl-supported import/export cache flags#2599

Merged
yangkaa merged 1 commit into
goodrain:mainfrom
yangkaa:fix/buildctl-cache-flags
Jun 12, 2026
Merged

fix(builder): use buildctl-supported import/export cache flags#2599
yangkaa merged 1 commit into
goodrain:mainfrom
yangkaa:fix/buildctl-cache-flags

Conversation

@yangkaa

@yangkaa yangkaa commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Dockerfile builds were failing with flag provided but not defined: -cache-from because the local BuildKit layer-cache args used buildx-style --cache-from/--cache-to, which buildctl build does not support.
  • Switch localBuildKitCacheArgs to buildctl's --import-cache/--export-cache (type=local, mode=max), keeping the same per-service cache directory layout.
  • Update the unit test to assert the buildctl flag names and reject the unsupported buildx flags.

Test plan

  • go test ./builder/build/ -run TestLocalBuildKitCacheArgs
  • go build ./builder/... and go vet ./builder/build/

buildctl build does not recognize buildx-style --cache-from/--cache-to
flags, causing every Dockerfile build to fail with "flag provided but
not defined: -cache-from". Switch the local layer cache args to
--import-cache/--export-cache as documented by buildctl.
@yangkaa yangkaa merged commit b4858aa into goodrain:main Jun 12, 2026
2 of 3 checks passed
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