expose-port-range
What it does
Section titled “What it does”Reports an EXPOSE with a port number above 65535. Several ports, /tcp and /udp suffixes and ranges (8000-70000) are all checked; a variable is not.
Why it matters
Section titled “Why it matters”TCP and UDP ports are 16-bit numbers from 0 to 65535. A larger number is a typo (a digit too many), and Docker rejects it as an invalid port, so the build fails.
Example
Section titled “Example”...WORKDIR /appWORKDIR $HOMEEXPOSE 8080 70000EXPOSE 80/tcp 443...Configuration
Section titled “Configuration”dockerfile: lint: rules: expose-port-range: error # off, warn, error (default)Enabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line expose-port-range 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 | DL3011 |
full |