Skip to content

Latest commit

 

History

History

README.md

Dockerfile vs rules_docker examples

This Bazel project provides examples on how to build Docker images using rules_docker. This project is structured such that every directory contains one separate example. For ease of understanding, each example also comes with the equivalent Dockerfile. In addition, all examples include tests that run against the image built from a Dockerfile and against the image generated by rules_docker.

Getting Started

Simply browse each directory and compare side by side the Dockerfile with the BUILD file where the Bazel targets to build images are defined.

In order to run the tests to verify the images' equivalence, you can run all the test targets (which also builds all the required images using rules_docker) by running the following from the root of this project:

$ bazel test //...

More Details

For further comparison details between Dockerfile and container_image from rules_docker, please refer to the Dockerfile reference and container_image reference