I have a fairly simple Dockerfile
and now would like to build a docker image using rules_docker.
Trying to use container_image
, it seems like I cannot use the Dockerfile
as input. Is there any way to build with a Dockerfile
?
Alternatively, you can build a docker load compatible bundle with: bazel build my/image:helloworld. tar . This will produce a tar file in your bazel-out directory that can be loaded into your local Docker client. Building this target can be expensive for large images.
Bazel is a fast, scalable, multi-language, and extensible build system. Skaffold can help build artifacts using Bazel locally; after Bazel finishes building container images, they will be loaded into the local Docker daemon.
Update: There is now a rule called dockerfile_image
. Read here for more details: https://github.com/bazelbuild/rules_docker/blob/master/contrib/dockerfile_build.bzl#L15
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With