Skip to content(if available)orjump to list(if available)

Docker Bake is now generally available

Docker Bake is now generally available

10 comments

·February 8, 2025

thangngoc89

FYI: Bake is a feature of Docker Buildx that lets you define your build configuration using a declarative file, as opposed to specifying a complex CLI expression. It also lets you run multiple builds concurrently with a single invocation.

A Bake file can be written in HCL, JSON, or YAML formats, where the YAML format is an extension of a Docker Compose file

From: https://docs.docker.com/build/bake/

miiiiiike

Is there a way to specify an image’s build dependencies without manually grouping targets for parallelization?

For example, if image D depends on both B and C to be built first and images B and C depended on A.

The build order would be:

0) A builds by itself.

1) B and C builds in parallel.

2) D builds by itself.

I built a tool to do this years ago and I’d really like to retire it.

Compose ignores “depends_on” for builds: https://github.com/docker/compose/issues/6332#issuecomment-4...

kevmo314

The targets documentation makes this seem like Bazel but everything is a container, so you don't have to learn the ins and outs of a build system versus using whatever tooling is most familiar + a thin Docker config layer. https://docs.docker.com/build/bake/targets/

Neat idea, I like it. Interested to see if it gets adopted more widely.

akshayshah

Earthly is a very similar idea too.

pm90

Neat! I hope this is part of the OSS interface so eg podman can implement something similar.

I can’t remember the last time I ran docker locally. All my docker builds now happen on remote clusters.

ei625

Make Docker chat so that we don't need to learn it again.

meow_cat

I'm not sure I understand the use case. What problems does this solve that a nice Docker Compose file doesn't?

null

[deleted]

null

[deleted]

lopkeny12ko

A quote from that page claims that Bake saves complexity by removing "all the flags and environment variables" from a build command, but as far as I can tell, all those flags and environment variables are still there, they're just now defined even more verbosely in an HCL file...