Skip to content

RUN instruction does not need any arguments #102

Description

@rcjsuen

Seems like you can have zero instructions for RUN when using BuildKit so we should add support for this.

FROM alpine:latest
RUN --mount=type=cache,target=/var/cache/foo,uid=1,gid=1
RUN
$ DOCKER_BUILDKIT=1 docker build --no-cache .
[+] Building 1.6s (8/8) FINISHED                                                                                           
 => [internal] load build definition from Dockerfile                                                                  0.0s
 => => transferring dockerfile: 116B                                                                                  0.0s
 => [internal] load .dockerignore                                                                                     0.0s
 => => transferring context: 2B                                                                                       0.0s
 => [internal] load metadata for docker.io/library/alpine:latest                                                      0.1s
 => CACHED [stage-0 1/3] FROM docker.io/library/alpine:latest@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412  0.0s
 => CACHED [internal] settings cache mount permissions                                                                0.0s
 => [stage-0 2/3] RUN --mount=type=cache,target=/var/cache/foo,uid=1,gid=1                                            0.8s
 => [stage-0 3/3] RUN                                                                                                 0.7s
 => exporting to image                                                                                                0.0s
 => => exporting layers                                                                                               0.0s
 => => writing image sha256:e3ee95c220624a5742c40a4fd98a3161d7b50a9c582bf3b1a2387a4679aebe54                          0.0s
$ node bin/dockerfile-utils lint
Line: 2
RUN --mount=type=cache,target=/var/cache/foo,uid=1,gid=1
^^^
Error: Instruction has no arguments

Line: 3
RUN
^^^
Error: Instruction has no arguments

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions