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
?
Asked
Active
Viewed 8,890 times
12

Jin
- 12,748
- 3
- 36
- 41

abergmeier
- 13,224
- 13
- 64
- 120
-
What is "container_image"? – SunghoMoon Dec 21 '17 at 17:41
-
The Bazel rule to build hermetic containers AFAIK – abergmeier Dec 21 '17 at 18:28
2 Answers
5
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

Luke Gehorsam
- 340
- 4
- 16
2
I think it's by design not allowed due to non-hermetic
nature of Dockerfile
. We can RUN
any command in Dockerfile
, including the ones non-hermetic (can't always been reproduced)
Further discussion here:

Pahlevi Fikri Auliya
- 4,157
- 8
- 35
- 71