single-healthcheck
What it does
Section titled “What it does”Reports each HEALTHCHECK after the first one in the same stage, HEALTHCHECK NONE included. A new FROM starts the count again.
Why it matters
Section titled “Why it matters”A container has one health check. When a stage lists several only the last one takes effect, so an earlier one (an interval or a command you tuned) is ignored and the container is judged by another check than the file suggests.
Example
Section titled “Example”...ENTRYPOINT ["a"]...HEALTHCHECK CMD bFROM alpine:3 AS last...USER app...Configuration
Section titled “Configuration”dockerfile: lint: rules: single-healthcheck: warn # off, warn (default), errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line single-healthcheck in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| hadolint | DL3012 |
full |