Skip to content

Fix docker run for 64 byte hex ID#21002

Merged
calavera merged 1 commit intomoby:masterfrom
tonistiigi:fix-id-noprefix
Mar 14, 2016
Merged

Fix docker run for 64 byte hex ID#21002
calavera merged 1 commit intomoby:masterfrom
tonistiigi:fix-id-noprefix

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

Fixes #20972

Also makes sure there is no check to registry if
no image is found for the prefixed IDs.

@aaronlehmann

Signed-off-by: Tonis Tiigi [email protected]

@aaronlehmann aaronlehmann added the status/failing-ci Indicates that the PR in its current state fails the test suite label Mar 7, 2016
@aaronlehmann
Copy link
Copy Markdown

@tonistiigi: Tests need updates.

I'm hesitant about allowing unprefixed 64-bit IDs for some commands (run, rmi) and not allowing it for others (tag, push, pull, etc.). I think if we're declaring that 64-bit IDs are okay as long as they're not tag references, we should remove the check that prevents them in the reference package, and instead have a check in docker tag that disallows creating them.

@aaronlehmann
Copy link
Copy Markdown

cc @dmcgowan

@dmcgowan
Copy link
Copy Markdown
Member

dmcgowan commented Mar 7, 2016

If it is supported for run and rmi, then it should also be supported on tag. I would be more in favor of detecting when these un-prefixed IDs are used and add the prefix before parsing. Are we trying to say that a 64-bit ID should always be interpreted as if the "sha256:" was implied? If that is the case we should just add the implied prefix without changing any of the image config interpretation code.

@tonistiigi
Copy link
Copy Markdown
Member Author

allowing unprefixed 64-bit IDs for some commands (run, rmi) and not allowing it for others (tag, push, pull, etc.).

Push and pull don't allow image IDs. Tag already works correctly like run and rmi.

@thaJeztah
Copy link
Copy Markdown
Member

What's the status here?

Also, looks like tests are failing @tonistiigi

@tonistiigi tonistiigi force-pushed the fix-id-noprefix branch 2 times, most recently from 1c6249b to 8a25180 Compare March 11, 2016 01:21
@tonistiigi
Copy link
Copy Markdown
Member Author

@aaronlehmann @dmcgowan I updated by adding a modified parser function for the cases where we allow both IDs and references but handle them bit differently. This maintains meaningful error messages and still catches invalid references. I think it's important to keep the distinction between IDs and refs and not just add extra validation on insertion to tagstore.

@tonistiigi tonistiigi removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Mar 11, 2016
Fixes moby#20972

Also makes sure there is no check to registry if
no image is found for the prefixed IDs.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi
Copy link
Copy Markdown
Member Author

Updated daemon.GetImageID to use the new parse function as well. Note that there is no functionality update in this function, just makes sense to use the same code for both of them as they are very similar.

@aaronlehmann
Copy link
Copy Markdown

LGTM

2 similar comments
@dmcgowan
Copy link
Copy Markdown
Member

LGTM

@calavera
Copy link
Copy Markdown
Contributor

LGTM

@samuraisam
Copy link
Copy Markdown

This appears to have regressed in 17.04.0-ce

In version 17.03.1 using docker tag [:tag] works fine.

@cpuguy83
Copy link
Copy Markdown
Member

cpuguy83 commented Apr 6, 2017

@samuraisam Can you open a new issue with the details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker run/create 'cannot specify 64-byte hexadecimal strings' sha256: leakage

8 participants