zypper package versions are not pinned

Specify reviewed package versions and maintain a security-update plan.

Description

With only a package name, zypper install can select a new version after a repository update. Reproducing a build also depends on the base image, dependencies, and repository state.

Potential impact

An unexpected update can change application behavior and make a failure harder to reproduce or roll back. Keeping an older version pinned can leave security fixes unapplied.

Remediation

  • Check the package name and version available in your repositories and specify a reviewed version using package=version.
  • Review security fixes and support periods when updating pins. Manage dependencies and repository snapshots when reproducibility matters.

Examples

The base image tag and httpd=2.4.58 are historical examples. For deployment, choose the Apache package name and a supported version and release available in your openSUSE repository.

Before

dockerfile
FROM opensuse/leap:15.6

RUN zypper install -y httpd \
    && zypper clean

After

dockerfile
FROM opensuse/leap:15.6

RUN zypper install -y httpd=2.4.58 \
    && zypper clean

Explanation:

  • Before: zypper selects the version of httpd from the repository.
  • After: httpd=2.4.58 can be installed only if the repository provides that package and version.

References