generic.dockerfile.correctness.multiple-entrypoint-instructions.multiple-entrypoint-instructions

Verifed by r2c
Community Favorite
profile photo of returntocorpreturntocorp
Author
62,846
Download Count*

Multiple ENTRYPOINT instructions were found. Only the last one will take effect.

Run Locally

Run in CI

Defintion

rules:
  - id: multiple-entrypoint-instructions
    severity: ERROR
    languages:
      - generic
    pattern: |
      ENTRYPOINT ...
      ...
      ENTRYPOINT ...
    message: Multiple ENTRYPOINT instructions were found. Only the last one will
      take effect.
    metadata:
      source-rule-url: https://github.com/hadolint/hadolint/wiki/DL4004
      references:
        - https://github.com/hadolint/hadolint/wiki/DL4004
        - https://kapeli.com/cheat_sheets/Dockerfile.docset/Contents/Resources/Documents/index#//dash_ref_Instructions/Entry/ENTRYPOINT/0
      category: correctness
      technology:
        - dockerfile
      license: Commons Clause License Condition v1.0[LGPL-2.1-only]
    paths:
      include:
        - "*dockerfile*"
        - "*Dockerfile*"

Examples

multiple-entrypoint-instructions.dockerfile

# cf. https://github.com/hadolint/hadolint/wiki/DL4004

FROM busybox
# ruleid: multiple-entrypoint-instructions
ENTRYPOINT /bin/true
ENTRYPOINT /bin/false