Repository navigation
Simplify docker:push using buildx bake's native compose support - #429
Merged
Merged
Conversation
…pport docker buildx bake can read docker-compose.yml directly (context, dockerfile, target, cache_from), removing the need to hand-parse the compose config and generate a temporary HCL bake file. cache-to and PHP_VERSION are injected via --set since they aren't declared in the compose file.
Spins up a disposable registry.:2 container plus a scoped buildx builder (isolated network + insecure-HTTP buildkitd config, so it works the same with the docker-container driver used in CI as with the plain docker driver) to actually build, push and verify the cache images, then tears everything down. Wired into CI as a dedicated step, and dropped by "castor init" like the other template-only files since it has no purpose in a generated project.
damienalexandre
approved these changes
Sep 3, 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
docker:pushnow letsdocker buildx bakereaddocker-compose.yml/docker-compose.dev.ymldirectly instead of hand-parsing the compose config and generating a temporary HCL bake file;cache-toandPHP_VERSIONare injected via--setsince they aren't declared in the compose file.docker:test-pushtask that builds and pushes real cache images to a throwaway registry (its own network + a scoped buildx builder, so it works whether the ambient builder uses thedockerordocker-containerdriver), then tears everything down.docker:test-pushinto CI, and madecastor initdrop the test file since it has no purpose in a generated project.Test plan
castor docker:push --dry-runand a realcastor docker:pushagainst a throwaway local registrycastor docker:buildstill works without attempting to push cachecastor docker:test-pushend-to-end, including with an isolateddocker-containerbuildx builder (the driver used in CI)castor qa:phpstan/ php-cs-fixer clean on all touched files