Skip to content

Support Make variable substitution in oci_push #866

@ouillie

Description

@ouillie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions