OBS Repositories and Docker Builds: Deterministic Dependency Resolution for openSUSE Leap Environments
0 reputation · 05 Oct 2026, 23:01 UTC
0 reputation · 05 Oct 2026, 23:01 UTC
Constructing a repeatable development environment on openSUSE Leap by consuming Open Build Service packages inside Docker images requires reconciling repository metadata behavior with container build semantics. The goal is identical installed package sets across builds, yet OBS repository metadata timestamps and mirror synchronization intervals can cause zypper's solver to select different package versions even when the source repository appears unchanged.
Docker layer caching and build-time flags such as --pull or cache-from further complicate this boundary by potentially reusing stale layers or fetching updated metadata without a corresponding source change. Additionally, OBS may trigger automatic rebuilds that alter binary outputs while preserving the same source version, creating a divergence between declared package versions and actual binaries.
When repository metadata timestamps vary across mirrors, does zypper's deterministic solver still produce identical package selections if the underlying RPM versions are unchanged? What Docker build configuration adjustments are needed to account for OBS auto-rebuilds that do not increment version numbers? Is a zypper lockfile sufficient to stabilize dependency resolution across OBS repository snapshots when mirror sync times differ?
32275 reputation · 06 Oct 2026, 10:03 UTC
1. Does a changing metadata timestamp alone alter zypper’s solver output when RPM NVRA values stay the same?
Zypper’s solver is deterministic with respect to the exact set of available RPMs. If the epoch:version:release (NVRA) of every package is unchanged, varying timestamps in the repository metadata do not influence which packages are selected. The solver only looks at the available NVRA set and the dependency graph, not at the age of the metadata files.
2. What Docker build tweaks must handle OBS auto‑rebuilds that keep the same NVRA?
zypper refresh -f) so the build always pulls the latest metadata from the snapshot, not from a cached layer.--no-cache or add a --pull flag combined with a --build-arg that changes when you want a new snapshot.--build-arg REPO_SNAPSHOT_URL that the Dockerfile passes to zypper addrepo to reference a specific snapshot URL.3. Is a zypper lockfile enough to keep installations identical across mirror syncs?
No. A lockfile (via zypper lock or files in /etc/zypp/locks) prevents upgrades to newer NVRA values, but it does not guard against OBS publishing a new binary build that has the same NVRA but a different payload checksum. The solver will still see the same NVRA and install it, even if the underlying RPM has changed.
# Dockerfile snippet for openSUSE Leap with OBS snapshot
FROM registry.opensuse.org/leap/15.6/base:latest
ARG REPO_SNAPSHOT_URL
ARG REPO_GPG_KEY
# Install zypper and refresh metadata from a fixed snapshot
RUN zypper --non-interactive install -y curl gnupg && \
curl -L -o /etc/zypp/repos.d/obs-snapshot.repo ${REPO_SNAPSHOT_URL} && \
zypper --gpg-auto-import-keys refresh -f && \
zypper --non-interactive install -y myapp
# Optional: lock the installed packages to avoid accidental upgrades
RUN zypper lock -p \
<package-names>
--no-cache and one with the default cache.rpm -qa --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' inside each container and compare the sorted lists.rpm -qi <pkg> | grep -i checksum to confirm that the payload differs while the NVRA stays the same.Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.