Skip to content

Separate entrypoints in a multi-stage build are marked erroneously as an error #72

@mplewis

Description

@mplewis

Issue details

I want Dockerlint to properly lint my multi-stage Dockerfiles. However, it doesn't seem to support using a CMD directive in more than one stage.

Steps to reproduce/test case

Put this into Dockerfile:

FROM busybox AS base

WORKDIR /tmp
CMD ["/bin/sh"]

########################################

FROM base AS whoami

CMD ["whoami"]

Then run dockerlint Dockerfile.

Expected behavior: Dockerlint succeeds on this file.

Actual behavior:

ERROR: Multiple CMD instructions found, only line 10 will take effect

ERROR: Dockerfile failed.

Affected version(s)

0.3.9

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