Fix docker run for 64 byte hex ID

Fixes #20972

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

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 16e4c4e481aca8d5a99d5a4760b5d27bf5bbb9fd
Component: engine
This commit is contained in:
Tonis Tiigi
2016-03-07 10:56:24 -08:00
parent 00a6cb83e9
commit 7d0b608cf5
5 changed files with 55 additions and 26 deletions

View File

@ -450,3 +450,11 @@ func (s *DockerSuite) TestCreateWithInvalidLogOpts(c *check.C) {
out, _ = dockerCmd(c, "ps", "-a")
c.Assert(out, checker.Not(checker.Contains), name)
}
// #20972
func (s *DockerSuite) TestCreate64ByteHexID(c *check.C) {
out := inspectField(c, "busybox", "Id")
imageID := strings.TrimPrefix(strings.TrimSpace(string(out)), "sha256:")
dockerCmd(c, "create", imageID)
}