Rethinking Docker build by Bazel

Docker has become the de facto standard for containerization, and Dockerfiles are the most common way to define how to build Docker images. However, Dockerfiles have some limitations, especially when it comes to managing complex builds and dependencies. Other approaches, such as Buildah or Podman’s Containerfile, also exist but use very similar syntax and concepts to Dockerfiles. Bazel, a powerful build tool developed by Google, offers an alternative way to build Docker images using the rules_oci extension. In this article, we’ll compare the traditional Dockerfile approach with Bazel’s rules_oci approach, highlighting possible improvements beyond Dockerfiles. ...

December 4, 2025