Skip to content

Nerdctl can't use locally built images in Dockerfile's #1442

@zagaria

Description

@zagaria

Description

Nerdctl can't use locally built images, every time trying to pull image from remote source.

Steps to reproduce the issue

  1. Create Dockerfile
FROM alpine:3.16

RUN apk update && apk add ca-certificates curl
  1. Build nerdctl build -t my-image:1.0.0 .
  2. Check images using nerdctl images
  3. Create new file test.Dockerfile that will use previously created image
FROM my-image:1.0.0

RUN apk update && apk add openssl
  1. Try to build nerdctl build -t my-image-2:1.0.0 -f test.Dockerfile .

Describe the results you received and expected

Received:

[+] Building 0.9s (3/3) FINISHED                                                                                                                                                                                   
 => [internal] load build definition from test.Dockerfile                                                                                                                                                     0.0s
 => => transferring dockerfile: 97B                                                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => ERROR [internal] load metadata for docker.io/library/my-image:1.0.0                                                                                                                                       0.9s
------
 > [internal] load metadata for docker.io/library/my-image:1.0.0:
------
test.Dockerfile:1
--------------------
   1 | >>> FROM my-image:1.0.0
   2 |     
   3 |     RUN apk update && apk add openssl
--------------------
error: failed to solve: my-image:1.0.0: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
FATA[0001] unrecognized image format

Expected: image successfully built

What version of nerdctl are you using?

master, v0.23

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

No response

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions