Skip to content

Commit 8e70c6b

Browse files
authored
The OCI distribution spec only allows lower case letter in container repository (#2252)
name (https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests), this doesn't bode well with Bazel package path using upper case. To be clear: docker itself is ok with upper case: https://ktomk.github.io/pipelines/doc/DOCKER-NAME-TAG.html. Picking the common denominator here, and force lower case on pkg path.
1 parent 6db7c12 commit 8e70c6b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

container/image.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ def _repository_name(ctx):
237237
"""Compute the repository name for the current rule."""
238238
if ctx.attr.legacy_repository_naming:
239239
# Legacy behavior, off by default.
240-
return _join_path(ctx.attr.repository, ctx.label.package.replace("/", "_"))
240+
return _join_path(ctx.attr.repository, ctx.label.package.lower().replace("/", "_"))
241241

242242
# Newer Docker clients support multi-level names, which are a part of
243243
# the v2 registry specification.
244244

245-
return _join_path(ctx.attr.repository, ctx.label.package)
245+
return _join_path(ctx.attr.repository, ctx.label.package.lower())
246246

247247
def _assemble_image_digest(ctx, name, image, image_tarball, output_digest):
248248
img_args, inputs = _gen_img_args(ctx, image)

0 commit comments

Comments
 (0)