Docker Bake is now generally available
docker.com
docker.com
A Bake file can be written in HCL, JSON, or YAML formats, where the YAML format is an extension of a Docker Compose file
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].
If you're interested in bake and want a go-to guide, we wrote this blog post a while back: https://depot.dev/blog/buildx-bake-deep-dive.
[1] https://depot.dev/changelog/2024-06-07-depot-cli-bake-multip...
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...
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.
See "Pinning an Alpine image" here: https://docs.docker.com/build/bake/contexts/#pinning-alpine-...
I can’t remember the last time I ran docker locally. All my docker builds now happen on remote clusters.
Neat idea, I like it. Interested to see if it gets adopted more widely.
Bake builds the containers from source