-
Notifications
You must be signed in to change notification settings - Fork 521
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
Bug: Link to Docker Hub gets confused when image is hash-pinned #4056
Comments
@rcjsuen can you look at this? Thanks! |
I did not know this was possible as I assumed it was either a tag or a digest. Perhaps the definition of "digest" is looser than I expected. @pnacht Would you happen to have a link to some official definition of "digest"? |
Not really, but I'm fairly certain it's precisely what you think it is. Docker allows using both a tag and a digest, but that effectively turns the tag into a "comment". When docker actually goes to fetch the image, it'll only care about the digest. It won't even validate that the tag exists. But having the tag there makes it easier for humans to understand what exactly is being fetched, and it gives automated tools such as dependabot a better idea of what to track. |
FROM [--platform=<platform>] <image> [AS <name>]
FROM [--platform=<platform>] <image>[:<tag>] [AS <name>]
FROM [--platform=<platform>] <image>[@<digest>] [AS <name>] The documentation mentions the three forms above. I wonder why it does not mention this "fourth" form which is the format in your file. FROM [--platform=<platform>] <image>[:<tag>][@<digest>] [AS <name>] As it is right now your example does not conform to any of the three forms but perhaps that is just an oversight that was missed in the documentation. |
The parser will have to be updated to handle this. I have opened rcjsuen/dockerfile-ast#112 to track this. |
Good point! I've opened docker/docs#18157 to track this. |
When I write a
FROM
command, a Docker Hub link is automatically created pointing to the image.Clicking on the underlined section in the image above, for example, takes me to https://hub.docker.com/r/cirrusci/windowsservercore/.
However, if I decide to hash-pin the image, the parser seems to get confused:
We can see the underlined section has moved, and the link now takes me to https://hub.docker.com/_/windowsservercore:2019/, which 404's.
Hash-pinning without the tag works correctly, as before:
The text was updated successfully, but these errors were encountered: