You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rules_docker decides the name of the resulting docker image:
bazel/{target}:{name}
The repository (`bazel/` by default) and `{target}` are fine. However,
we want to customize the tag part -- the thing after the colon. This
patch allows customizing the last part.
Why?
====
In our case, we are always building two images for two architectures
using transitions. Here is an extract of a macro that builds two
containers:
Then we build two containers using outgoing transitions:
container_image(
name = "{name}-post_transition".format(name = name),
...,
)
multiplatform_image(
name = "{name}-amd64".format(name),
src_image = ":{name}-post_transition".format(name = name),
...,
)
multiplatform_image(
name = "{name}-arm64".format(name = name),
src_image = ":{name}-post_transition".format(name = name),
...,
)
Both images (`-amd64` and `-arm64`) build correctly, but the resulting
image name, according to Docker, happens to be
`bazel/{target}:{name}-post_transition`. So the internal implementation
details of the transitions leak to the resulting images.
This patch makes it possible to rename the post-transition image name to
something we like more, e.g. the architecture name, or remove the suffix
altogether.
0 commit comments