Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: allow + in tag names #16304

Closed
nakedible-p opened this issue Sep 15, 2015 · 12 comments
Closed

enhancement: allow + in tag names #16304

nakedible-p opened this issue Sep 15, 2015 · 12 comments
Labels
area/distribution kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Comments

@nakedible-p
Copy link

Currently tags must satisfy the regexp ^[\w][\w.-]{0,127}$. That means that tags allow _, . and - apart from letters and numbers.

Semantic Versioning is quite a common versioning system today, used in NPM and in increasing numbers in other projects, including Docker itself. Semantic Versioning 2.0.0 says:

Build metadata MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence. Examples: 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85.

This means that Semantic Versioning version numbers can in full represented by Docker tags, with the exception of the plus sign. Adding the plus sign as an allowed character in tags would allow all semantic versions to be directly used as docker tags.

It is obvious that there are a lot of competing versioning schemes and there are probably a lot of other characters that would be required for some of them as well, so the addition of just the plus sign is probably a judgement call.

However, I wanted to suggest this because of the widespread usage of semantic versioning and let the project make the judgement call.

@cpuguy83 cpuguy83 added area/distribution kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Sep 15, 2015
@thaJeztah
Copy link
Member

/cc @stevvooe

@stevvooe
Copy link
Contributor

My concern with the "+" character is its overloading for "space" in URLs, which is commonly used in registry APIs. This is a massive risk, so without a close study, the default answer would have to be "no".

That said, I do see the need for compatibility with semantic versioning, albeit, the specification is pretty clear that this is only metadata:

Build metadata SHOULD be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence.

I am not sure if this change is worth the risk or effort it requires.

@nakedible-p
Copy link
Author

FWIW, as context for this request, we use the metadata in our image builds to mark the base image version the image was built against. For example "2.5.3+base.1.2.1". This is because we need to be able to rebuild old software versions against new base images without any code changes to the repository.

Our current workaround is simply to do tr + _ for the docker version tag only. Would be nicer if the version would match directly to lessen confusion but ultimately everything works perfectly with this simple hack.

I do see the concerns as valid (even though "+" is "space" in query strings only) and don't really have a solid opinion one way or the another.

@stevvooe
Copy link
Contributor

I do see the concerns as valid (even though "+" is "space" in query strings only)

If only the world were so simple.

If you're willing to do the footwork of ensuring that the existing registry implementations and docker daemons will be compatible, we may be able to consider this.

@nakedible-p
Copy link
Author

I am willing to do the footwork, but first I'd like to get some confirmation that this feature is desired by atleast somebody other than us - there's no point in adding the "+" there if nobody is going to use it.

@stevvooe
Copy link
Contributor

@nakedible-p You've found your match: distribution/distribution#1202

;)

@LK4D4
Copy link
Contributor

LK4D4 commented Sep 16, 2016

@stevvooe Do you think it's still worth to research? It was almost a year.

@stevvooe
Copy link
Contributor

@LK4D4 This is pending some due diligence on using these in urls. We can merge distribution/distribution#1202 once this is done.

@lorddaedra
Copy link

Will be good to have ability to use pluses to stay close with Python PEP 440 https://www.python.org/dev/peps/pep-0440/#local-version-identifiers

@stevvooe
Copy link
Contributor

stevvooe commented May 8, 2017

@lorddaedra No one is disagreeing that this might be useful in certain cases. Here is the list of requirements for getting this through: distribution/distribution#1202 (comment).

If someone is willing to do the due diligence and testing, please let me know.

@AkihiroSuda
Copy link
Member

This should be discussed in OCI Distribution Spec repo if there is still demand for this: https://github.com/opencontainers/distribution-spec

@solarmosaic-kflorence
Copy link

There is now a ticket for this in the OCI Distribution Spec here: opencontainers/distribution-spec#154

krestomatio-cibot pushed a commit to krestomatio/container_builder that referenced this issue Mar 19, 2021
krestomatio-cibot pushed a commit to krestomatio/container_builder that referenced this issue Mar 19, 2021
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Oct 5, 2023
Docker tags do not support "+" as part of their name [1], so turn e.g.
"3.0.1-SNAPSHOT+003.sha.cc0865e" into "3.0.1-003.sha.cc0865e" by using
the build part as the pre-release part. SemVer sorting rules [2] are still
so that 3.0.1-003.sha.cc0865e < 3.0.1.

[1]: moby/moby#16304
[2]: https://semver.org/#spec-item-11

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Oct 5, 2023
Docker tags do not support "+" as part of their name [1], so turn e.g.
"3.0.1-SNAPSHOT+003.sha.cc0865e" into "3.0.1-003.sha.cc0865e" by using
the build part as the pre-release part. SemVer sorting rules [2] are still
so that 3.0.1-003.sha.cc0865e < 3.0.1.

[1]: moby/moby#16304
[2]: https://semver.org/#spec-item-11

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
sschuberth added a commit to oss-review-toolkit/ort that referenced this issue Oct 5, 2023
Docker tags do not support "+" as part of their name [1], so turn e.g.
"3.0.1-SNAPSHOT+003.sha.cc0865e" into "3.0.1-003.sha.cc0865e" by using
the build part as the pre-release part. SemVer sorting rules [2] are still
so that 3.0.1-003.sha.cc0865e < 3.0.1.

[1]: moby/moby#16304
[2]: https://semver.org/#spec-item-11

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/distribution kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.
Projects
None yet
Development

No branches or pull requests

8 participants