This would allow, among other thing, configuring the registry using a command-line flag, e.g.:
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
string_flag(
name = "registry",
make_variable = "REGISTRY",
build_setting_default = "localhost:5000",
)
oci_push(
name = "image-push",
image = "//some:image",
remote_tags = ["latest"],
repository = "$(REGISTRY)/image-name",
toolchains = [":registry"],
)
Then you could run:
bazel run //package:image-push --//package:registry=docker.io/library
Implementing this is just a matter of running ctx.expand_make_variables.
This would allow, among other thing, configuring the registry using a command-line flag, e.g.:
Then you could run:
Implementing this is just a matter of running
ctx.expand_make_variables.