Skip to content

Using FROM <image_id> doesn't work when using DOCKER_BUILDKIT=1 #2204

Open
@bossmc

Description

@bossmc

If you have a Dockerfile of the form:

FROM sha256:abcdefgxxxxxxxxxxxxxxxx
[...]

Then docker build fails but only if buildkit is in use (tested with DOCKER_BUILDKIT=1 as well as docker buildx):

$ DOCKER_BUILDKIT=0 docker build .
Sending build context to Docker daemon  7.168kB
Step 1/2 : FROM sha256:06017009f887cf12ab636d362e9c0170acac7735a1cc0ee786e720385a37d619
 ---> 06017009f887
Step 2/2 : LABEL GOODBYE="Have a nice day!"
 ---> Running in e8772594c7e4
Removing intermediate container e8772594c7e4
 ---> acc07f1c0296
Successfully built acc07f1c0296

vs

$ DOCKER_BUILDKIT=1 docker build .
[+] Building 1.1s (4/4) FINISHED                                                                                                                                                                                                             
 => [internal] load build definition from Dockerfile                                                                                                                                                                              0.0s
 => => transferring dockerfile: 33B                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => ERROR [internal] load metadata for docker.io/library/sha256:06017009f887cf12ab636d362e9c0170acac7735a1cc0ee786e720385a37d619                                                                                                        1.0s
 => [auth] library/sha256:pull token for registry-1.docker.io                                                                                                                                                                           0.0s
------
 > [internal] load metadata for docker.io/library/sha256:06017009f887cf12ab636d362e9c0170acac7735a1cc0ee786e720385a37d619:
------
error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions