zypper-pin-versions
What it does
Section titled “What it does”Reports a zypper install (in) of a package without a version. A package is pinned when its name has =, < or > (curl=7.88.1) or when it is a .rpm file.
Why it matters
Section titled “Why it matters”An unpinned install takes the newest version in the enabled repositories on the day of the build. Two builds of one Dockerfile can then differ, and a new release can break the image without any change in your code.
Pinned versions make the build repeatable. Repositories drop old versions, so a pin needs updating from time to time.
Example
Section titled “Example”...RUN dnf install -y curl-7.0 && dnf clean all...RUN zypper install curlRUN zypper install -y curl=7.0 && zypper cleanRUN zypper install -y curl...RUN zypper -n in curl=1 && zypper ccConfiguration
Section titled “Configuration”dockerfile: lint: rules: zypper-pin-versions: warn # off (default), warn, errorEnabled by the presets: dockerfile/hadolint.
Suppress one line with sudsy-disable-next-line zypper-pin-versions 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 | DL3037 |
full |