Skip to content

docker run with sha #2815

@johanneswuerbach

Description

@johanneswuerbach

Description

docker run fails to run images by digest without the sha256: prefix with version 20.10.0-beta1.

Steps to reproduce the issue:

  1. New behaviour
$ docker version
20.10.0-beta1
$ docker build --pull -q . -f-<<EOF
FROM busybox
CMD echo "hello world"
EOF
sha256:9b3cf996b8a64e68ab6b9342b7cda274f63085ac303d9d55e33a3349dcff8f36
$ docker run --rm 9b3cf996b8a64e68ab6b9342b7cda274f63085ac303d9d55e33a3349dcff8f36
docker: Error response from daemon: invalid repository name (9b3cf996b8a64e68ab6b9342b7cda274f63085ac303d9d55e33a3349dcff8f36), cannot specify 64-byte hexadecimal strings.
  1. Previous behaviour
$ docker version
19.03.12
$ docker build --pull -q . -f-<<EOF
FROM busybox
CMD echo "hello world"
EOF
sha256:1c1941709ada55146ea0b49b18a59b463feeb9f4de0acedb0620e6f034b54bd9
$ docker run --rm 1c1941709ada55146ea0b49b18a59b463feeb9f4de0acedb0620e6f034b54bd9
hello world


Reading the docs it isn't fully clear to me whether this way to run was supported https://docs.docker.com/engine/reference/commandline/run/, but it is also not listed as breaking change in https://github.com/docker/docker-ce/blob/0fc7084265b3786a5867ec311d3f916af7bf7a23/CHANGELOG.md

This change was likely introduced in #1498 where the image is pulled now before being created, while it was just created before.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions