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
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...
It's cool to see bake go GA. We've been supporting bake at Depot [0] for a while now and it is a unsung hero when it comes to building multiple images in parallel.
We help many folks adopt it for their monorepo setups in particular. With Depot, folks can get the highly parallelized builds right out of the box, but bake takes it to another level by allowing you to define all your image builds in one place like an HCL, Compose, or JSON file. We've added some extra spice to fan out builds across multiple BuildKit instances [1].
Hm, that’s interesting. Are you saying just specifying the FROM in the Dockerfile is enough? I’ve seen a trick floating around specifying from in the bake config in addition to Dockerfile.
You can create contexts that point to other targets. So in your Dockerfile you can use `FROM project-base` where `project-base` is whatever you specified in the context.
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.
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/