Skip to content

nerdctl fails to build for dockerfiles with full path #206

@seemethere

Description

@seemethere

nerdctl installed with rootless containerd and buildkit fails to build dockerfiles when the dockerfile specified is a full path:

Simple Repro

Create test Dockerfile in your root directory (Dockerfile):

FROM alpine
RUN apk -U add curl

Run the following

$ nerdctl build -f $(realpath Dockerfile) .
[+] Building 0.1s (2/2) FINISHED                                                                                                                          
 => [internal] load build definition from /tmp/tmp.gdczD7DusJ/Dockerfile                                                                             0.1s
 => => transferring dockerfile: 2B                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                    0.1s
 => => transferring context: 2B                                                                                                                      0.0s
error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /tmp/buildkit-mount044783237/tmp/tmp.gdczD7DusJ/Dockerfile: no such file or directory
FATA[0000] unrecognized image format   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions