Skip to content

Instantly share code, notes, and snippets.

@nij4t
Created August 29, 2021 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nij4t/3f07c67ab6761c80ced9512092cedd1b to your computer and use it in GitHub Desktop.
Save nij4t/3f07c67ab6761c80ced9512092cedd1b to your computer and use it in GitHub Desktop.
Macro that generates multiple targets for container image push
load("@io_bazel_rules_docker//container:container.bzl", "container_push")
def push_multiple_containers(registry, tag, images, visibility = ["//visibility:public"], **kwargs):
[container_push(
name = "push_" + image.get("name"),
image = image.get("image"),
format = "Docker",
registry = registry,
repository = image.get("repository"),
tag = tag
) for image in images]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment