I am trying to build a Docker image with this code:
container_image(
name = "docker_image",
base = "@java_base//image",
files = [":executable_deploy.jar"],
cmd = ["java", "-jar", "executable_deploy.jar"],
env = { "VERSION" : "$(VERSION)" }
)
I want to pass a variable to the target built so it can be replaced in $(VERSION). Is this possible?
I have tried with VERSION=1.0.0 bazel build :docker_image, but I get an error:
$(VERSION) not defined.
How can I pass that variable?
The values of this field (env) support make variables (e.g., $(FOO)) and stamp variables; keys support make variables as well. But I don't understand exactly what that means.