3 ms·
My company uses Bazel's rules docker to build our images: https://github.com/bazelbuild/rules_docker https://github.com/bazelbuild/rules_docker They're pretty
by rockwotj 4y ago
My company uses Bazel's rules docker to build our images: https://github.com/bazelbuild/rules_docker https://github.com/bazelbuild/rules_docker
They're pretty great and have a lot of the caching and parallelism benefits mentioned in the post for free out of the box, along with determinism (which Docker files don't have because you can run arbitrary shell commands). Our backend stack is also built with Bazel so we get a nice tight integration to build our images that is pretty straightforward.
We've also built some nice tooling around this to automatically put our maven dependencies into different layers using Bazel query and buildozer. Since maven deps don't change often we get a lot of nice caching advantages.
- malkia 4y agoHuge fan of bazel, and was using rules_docker, but these still do not work under Windows last time I checked, which is my main dev platform. I know I can probably tweak it through WSL2, so it's on my list of things to try.
- wofo 4y agoThanks for sharing! This will definitely be interesting to look at :)
- autophagian 4y agoI've also enjoyed using nixpkg's dockerTools for this kind of thing too.
- MuffinFlavored 4y agoIf this ends up being a cleaner/easier way to having to workaround super expensive rebuilds for Rust given cache + deps compared to this https://github.com/LukeMathWalker/cargo-chef https://github.com/LukeMathWalker/cargo-chef , reading this thread will have been a huge win for me (and hopefully others). Whether introducing Bazel is easier/worth it, subjective I guess.
- Arbortheus 4y agoWe use bazel for our builds at work, I think it works quite well, but then our bazel guy left the company and no one else dares touch it aside from basic updates because it’s really complex and a bit of a dark art in itself.
- rockwotj 4y agoHaha yeah I understand this well. I'm the Bazel guy at our company. Basic stuff is simple but as soon as you dip into more complex stuff like the queries and buildozer you quickly need to have a lot of information to be productive
- dijit 4y agoOut of interest, how did you learn Bazel? I've been trying for a while and, while I get the concepts, I'm struggling to get anywhere productive with it.
- rockwotj 4y agoI worked at Google, then created a bunch of stuff with Bazel (ie most of shortwave.com is built with Bazel). I've picked stuff up over a few years and often study open source rule sets to learn how stuff works under the hood