November 26, 2026

Reproducible builds with Debian Testing

Reproducible builds with Debian Testing

Sometimes Debian Stable doesn't have the versions of the packages you need.

Take Python, for example. Debian 13 (Trixie) ships with Python 3.13, while Debian Testing already provides Python 3.14, which introduces features such as template string literals (t-strings).

While you could install a newer version of Python independently, Debian Testing gives you access to a whole distribution of newer packages. This is particularly useful if you're developing software against newer system libraries and toolchains or testing compatibility with the next Debian release.

But what if you want to keep using the same set of dependencies once you've got your build working?

‍

Building against a moving repository

Debian Testing is where the next stable release of Debian takes shape. Packages migrate from Unstable into Testing after passing checks for dependencies, test failures and release-critical bugs.

Unlike Stable, Testing regularly receives new upstream versions of packages. Running the same apt install command a week later can therefore give you a different set of dependencies.

You could specify individual package versions in your Dockerfile, but those packages have dependencies of their own. Even if you pin all of them, older versions can disappear from the repository as newer ones take their place.

There's an important distinction between wanting newer dependencies and wanting continuously changing dependencies.

If you've chosen Debian Testing because you need a particular compiler, library or runtime, there's no reason to introduce unrelated dependency changes every time your CI pipeline runs.

‍

Pinning Debian Testing with StableBuild

We've recently added support for Debian Testing following a request from one of our customers.

As with our other Debian repositories, we mirror Testing daily, preserving both the repository indexes and the packages themselves. Rather than specifying individual package versions, you can pin the entire repository to a particular date.

Here's how the version of curl changed across three of our Debian Testing snapshots:

‍

APT snapshot curl version
November 11, 2026 8.22.0-1
November 13, 2026 8.22.0-1
November 24, 2026 8.23.0-2

‍

By pinning your APT repositories to the November 11 snapshot, your builds continue to have access to the same package versions, even as Debian Testing moves forward.

When you're ready to update your dependencies, you can change the pin date, run your tests and commit the change alongside the rest of your code. If an update breaks something, you can go back to the previous snapshot.

‍

Getting started

We've created a small example repository showing how to pin both a Debian Testing Docker base image and its APT repositories with StableBuild:

ARG SB_API_KEY=stablebuild-pub-debtesting-ex

FROM ${SB_API_KEY}.dockermirror.stablebuild.com/debian:testing-20261104

ARG SB_API_KEY
ARG APT_PIN_DATE=2026-11-11T08:40:01Z

COPY ./sb-apt.sh /opt/sb-apt.sh
RUN bash /opt/sb-apt.sh load-apt-sources debian-testing

RUN apt update && apt install -y curl 

If you're already using StableBuild to pin Debian repositories, the setup should look familiar. The main difference is that we pass debian-testing instead of debian to sb-apt.sh.

The APT_PIN_DATE selects the APT snapshot. The base image is pinned separately. There's no need to change how you install packages with APT.

‍

Beyond Debian packages

Debian already provides historical repository snapshots through snapshot.debian.org. However, the service can be unreliable at times.

However, a typical Docker build often relies on more than just Debian packages. You might also be pulling a base image from Docker Hub, installing Python packages from PyPI, using third-party APT repositories or downloading files directly from GitHub.

With StableBuild, you can preserve all of these through the same service. You can also pin your OS packages and supported third-party APT repositories using a single date, rather than managing separate historical mirrors for each repository.

Debian Testing now fits into that same workflow.

The feature is available on all paid StableBuild plans. To get started, head over to the StableBuild dashboard and select Debian Testing when configuring your APT repositories.