Skip to content

Add a compose build --print flag #12654

Closed

Description

@emersion

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.

Activity

  1. ndeloof commented on Mar 21, 2025

    @ndeloof
    Contributor

    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

  2. emersion commented on Mar 21, 2025

    @emersion
    ContributorAuthor

    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.

  3. emersion commented on Mar 27, 2025

    @emersion
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions