Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a compose build --print flag #12654

Closed
emersion opened this issue Mar 20, 2025 · 3 comments · Fixed by #12675
Closed

Add a compose build --print flag #12654

emersion opened this issue Mar 20, 2025 · 3 comments · Fixed by #12675

Comments

@emersion
Copy link
Contributor

Description

docker buildx bake has a convenient --print flag to print the final bake file as JSON. docker buildx supports compose files, however it lags behind on some features (e.g. services in additional_contexts). It would be nice to add the same --print flag to compose.

@ndeloof
Copy link
Contributor

ndeloof commented Mar 21, 2025

If you run COMPOSE_BAKE=true docker compose --verbose build you'll set in logs the bake file being produced by compose to run the build

@emersion
Copy link
Contributor Author

Yeah, but I'd like to save this to a file and feed this to another tool. I can do that with docker buildx bake --print >bake.json, but not reliably with docker-compose.

@emersion
Copy link
Contributor Author

Thank you so much!

(Note, I would've been willing to send a PR - next time feel free to ask me to do so :) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants