rules_docker icon indicating copy to clipboard operation
rules_docker copied to clipboard

container_image may produce invalid tags with recent changes to allowed characters in Bazel labels

Open clintharrison opened this issue 7 years ago • 2 comments

As of https://github.com/bazelbuild/bazel/commit/1615da781db78b7a910daf89720189c2b2e73dbe (and I believe an earlier change allowing almost all non-control ASCII characters), a package name may not be a valid Docker image tag.

I believe this stems from https://github.com/bazelbuild/rules_docker/blob/master/container/image.bzl#L367 -- are we comfortable replacing any forbidden characters with _ or similar? This does mean distinct Bazel targets could have the same image tag, but I am not sure this edge case would be a common occurrence.

clintharrison avatar Sep 14 '18 17:09 clintharrison

thanks for pointing this out, and thanks for the suggestion, this definitely needs to be something we change with care to not create unreasonable burden on devs to figure out how their package names are converted to docker image tags. We'll come up with some alternatives and post here for comments/feedback soon.

nlopezgi avatar Sep 14 '18 17:09 nlopezgi

Related: https://github.com/bazelbuild/rules_docker/blob/master/contrib/test.bzl#L124

xingao267 avatar Sep 14 '18 18:09 xingao267