|
|
|
|
|
by erain
3034 days ago
|
|
For your docker container needs:
"Bazel should in theory be able to decide if a docker image should be rebuilt" You can checkout Bazel's docker rule:
https://github.com/bazelbuild/rules_docker Also, go already has a very good build sysmtem build-in, and hazel really shines when:
- you have a complex codebase with multi-languages: one can build a tool in one language and use it as tool for a another language.
- you simply have a really large code base - you can work on the path //service1/my/service and your colleague can work on //service2/their/service, and only the path got changed needs to rebuild every time. |
|
In order to ensure reproducibility/determinism, however, Bazel doesn't have an equivalent of the RUN instruction. You have to use other Bazel rules to fetch and produce artefacts and add them to an image, and there aren't always rules for what it is you want to do (I have a spot of bother with installing pip packages, for which there is apparently alpha support).
This is, I think, the thing with Bazel: it has to re-invent everything to ensure this reproducibility and hermetic seal, because it doesn't trust existing build tools to do this, and quite rightly so if this is what you're seeking. But I suspect it's going to be painful doing things outside the mainstream supported stuff.
[1] https://github.com/google/containerregistry