I would like to push a Docker image to a registry with as tag the SHA-256 digest of the image. I am using Bazel and more specifically container_push
from docker_rules. Unfortunately, I am unable to retrieve the image's digest and tag the image with it.
Assuming I have the following BUILD.bazel config, how can I do this?
go_image(
name = "image",
embed = [":app1_lib"],
goarch = "amd64",
goos = "linux",
)
container_push(
name = "publish",
format = "Docker",
image = ":image",
registry = DOCKER_REGISTRY,
repository = "app1",
skip_unchanged_digest = True,
tag = "{ ??? }",
)