no-nested-onbuild
What it does
Section titled “What it does”Reports an ONBUILD whose instruction is ONBUILD, FROM or MAINTAINER.
Why it matters
Section titled “Why it matters”Docker does not allow these as triggers: ONBUILD ONBUILD, ONBUILD FROM and ONBUILD MAINTAINER are rejected with an error when the file is built, so the Dockerfile cannot be used.
Example
Section titled “Example”...ONBUILD CMD echo hiONBUILD ONBUILD RUN xONBUILD MAINTAINER x...Configuration
Section titled “Configuration”dockerfile: lint: rules: no-nested-onbuild: error # off, warn, error (default)Enabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line no-nested-onbuild 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 | DL3043 |
full |