this post was submitted on 11 Apr 2025
6 points (100.0% liked)

Docker

1248 readers
2 users here now

founded 2 years ago
MODERATORS
 

I noticed docker compose is now telling me I can set COMPOSE_BAKE=true for "better performance".

Does anyone have any experience with this? Is it worth it? I get suspicious when a program tells me "just use this, it has better performance", but it's not the default.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 2 points 1 day ago* (last edited 1 day ago) (1 children)

I haven't used it myself, and I've only just learned about it through this post.

Reading through the docs, though, it seems more beneficial if you are on a team of people. Seems like it basically combines Compose and a custom run/build script into one idea.

Personally, for my solo projects, I will likely continue using just compose for multi-service projects and basic docker run for stupid stuff. Unless I'm missing something, it doesn't seem like there is too much of a benefit with Bake if you're solo. It just adds more config files and json to your project IMO.

They even state as much in the introduction:

For simple builds, the difference between docker build and docker buildx bake is minimal. However, as your build configuration grows more complex, Bake provides a more structured way to manage that complexity, that would be difficult to manage with CLI flags for the docker build. It also provides a way to share build configurations across your team, so that everyone is building images in a consistent way, with the same configuration.

~~Reading the docs a little can go a long way in understanding.~~ My bad, didn't seem like you had read up on it.

ETA: Thinking on it more, it seems less useful to implement unless your project is 100% inside Docker. If you need to do other things besides build a Docker image or two from a compose file, it is much easier to accomplish what you need through a bash script that can interact with more than just Docker. Even if I did implement this, I'm going to end up wrapping the bake commands with a bash script any way.

[–] [email protected] 2 points 1 day ago (1 children)

I did read the docs. My question is more about the actual user experience, like has any team used this? Building images is not a bottleneck of mine and most of my projects are small, so I was curious with the discrepancy between:

  1. Docker compose cares enough about this to pollute every build output with an 'advertisement' for it
  2. It's not the default?

When I see something like that, I get curious. If you haven't tried it, that's fair. Just looking to hear from a user, happy or not.

[–] [email protected] 2 points 1 day ago (1 children)

From the way you worded the post, it didn't seem like you had looked into it very much. If you want to compare to similar experiences, this looks to me like Docker's version of a lockfile.

They don't even use the actual word "performance" on any of the doc pages for Bake, so the build output thing is very poorly worded, and it sucks that they feel the need to put it in build output.

[–] [email protected] 2 points 1 day ago

and it sucks that they feel the need to put it in build output.

I agree. I treat that as holy ground. If it doesn't have really large implications, I do NOT want to see it in the output. Reminds me of installing things in npm and seeing all the little 'shoutouts'.