-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
image.bzl: implement
tag_name
(#2205)
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.
- Loading branch information
Showing
5 changed files
with
28 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters