docker / desktop-linux

Bug reports for Docker Desktop for Linux
https://docs.docker.com/desktop/linux/
77 stars 5 forks source link

Impossible to push image with a dash on path #141

Closed baiiko closed 1 year ago

baiiko commented 1 year ago

Actual behavior

Hey people,

I have a similar bug on github actions and on my computer. I try to push an image with my oldes github name : GuigZ-, but i can not.

> $ docker build -f ./docker/php/Dockerfile -t docker.pkg.github.com/guigz-/foobar:latest ./docker/php/

I have got this error :

ERROR: invalid tag "docker.pkg.github.com/guigz-/foobar:latest": invalid reference format

Information

sudo-bmitch commented 1 year ago

The - and other separators are only allowed in the middle of a path component, not at the end:

So guigz- is not a valid path component, but guigz-x would be. This is a scenario where the naming restrictions on github usernames is weaker than the naming requirements for path entries in container registries.

baiiko commented 1 year ago

Lot of users use dahs or underscore at the end of his username 😨

It's a very strange rule :/

I go open an issue on github 🤣

thaJeztah commented 1 year ago

Ahm, yes, that's an interesting situation indeed.

I know the original reason for disallowing separators at the start / end was to at least prevent leading hyphens, as they could easily conflict with command-line options when using the "common-name" format (e.g. docker push --hello/myimage). Given that it's easier to become less restrictive than more restrictive (without breaking backward compatibility), we decided to only allow hyphens to be used as separator (and disallow both at the start and end). Technically it would be possible to allow these, but that will require a change in the specification (and it will take time before that's supported everywhere).

I'll close this ticket here, because it's not a bug, but feel free to continue the conversation.

docker-robott commented 1 year ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked