Mirror of Stagex. File issues and make PRs to https://codeberg.org/stagex/stagex
Dockerfile
1
2,236 commits
updated Sep 20, 2026
git://codeberg.org:stagex/stagex | matrix://#stagex:matrix.org | ircs://irc.oftc.net:6697#stagex
Minimalism and security first repository of reproducible and multi-signed OCI images of common open source software toolchains full-source bootstrapped from Stage 0 all the way up.
If you want to build or deploy software on a foundation of minimalism and determinism with reasonable security, StageX might be the solution you are looking for.
You can do anything with these images you would with almost any other musl based containerized Linux distro, only with high supply chain integrity and determinism.
For a full list of images see the "packages" directory or check our website
docker run -it stagex/stage3
docker run -it stagex/pallet-python -c "print('hello, world!')"
FROM stagex/pallet-rust AS build
RUN ["cargo", "new", "--bin", "pattern_matcher"]
WORKDIR /pattern_matcher
RUN ["cargo", "add", "regex"]
COPY <<-EOF /pattern_matcher/src/main.rs
use regex::Regex;
fn main() {
let mut args = std::env::args();
args.next();
let pattern = args.next().expect("pattern not given");
let text = args.next().expect("text to match not given");
let re = Regex::new(&pattern).expect("given pattern is invalid regex");
if let Some(r#match) = re.find(&text) {
println!("Found match: {match:?}");
}
}
EOF
ENV RUSTFLAGS="-C target-feature=+crt-static"
RUN ["cargo", "build", "--release"]
FROM stagex/core-filesystem AS package
COPY --from=build /pattern_matcher/target/release/pattern_matcher /usr/bin/pattern_matcher
ENTRYPOINT ["/usr/bin/pattern_matcher"]
Note the difference between the "build" and the final image: build has to
pull the rust pallet, which includes just the binaries required to build a
Rust program, but the final OCI image only contains the statically compiled
Rust binary, and is tiny as a result.
Oftentimes, you'll need dependencies that aren't included by default, such as
clang when building crates using Rust's bindgen crate. StageX makes adding
packages super simple. In your build phase, add the following line:
COPY --from=stagex/core-clang . /
No RUN commands needed.
Unlike most Linux distros, StageX adopts an OCI-first design: Open Container Initiative (OCI) images are the native packaging system, not just a distribution format. This means system components are immutable, pre-built container images that are constructed, signed, and verified outside the runtime environment. During installation, no arbitrary scripts are run. Image verification and unpacking are the primary operations, significantly reducing the attack surface.
StageX packages things in the most "stock" way possible, with exceptions only to maintain determinism.
Every image is "from scratch" and contains an empty filesystem with the installed package. Because StageX images comply with OCI specifications, they run without modification across Docker, Podman, containerd, and any other compliant runtime, reducing single points of failure in the runtime layer. Distribution is handled through established tooling (skopeo, oras) with built-in support for security hardening, sandboxing, and provenance tracking. Immutable images facilitate atomic upgrades and rollbacks, enhancing operational stability.
By default you always get the latest updates to dependencies on the fly, but you retain the option for bit-for-bit reproducible builds by locking any given dependency at a particular tag or image hash.
This allows you to use the version you need regardless of the situation without resorting to low security "curl | bash" style solutions.
Please keep in mind that even though we provide older versions of packages usually indicated by the number after the package (such as llvm21) we maintain a rolling release approach and only provide them for backwards compatibility. These can be removed at any time without previous notice.
We built StageX to satisfy high-assurance threat models where trusting any single system or maintainer in the software supply chain cannot be tolerated. Our design enforces strict verifiability across five core criteria, making StageX the first Linux distribution to integrate all of the following into a unified, self-consistent model. See our whitepaper for the formal analysis.
We have learned a lot of lessons about supply chain integrity over the years, and the greatest of them may be that any system that is complex to review and assigns trust of significant components to single individuals, which creates significant points of failure, will lead to eventual compromise.
Distros (Linux distributions) rely on complex package management systems for which only a single implementation exists. They typically generate a lot of custom tooling, which in turn rapidly grows in complexity to meet demands ranging from hobby desktops to production servers. This complexity demands a lot of effort to maintain, and in practice results in a tendency to reduce security overhead in order to lower the barrier to entry to attract more maintainers. As a result, projects rarely mandate cryptographic signing or reproducible builds, let alone multiple signed reproduction proofs. In fact, some popular distros use a server to blindly sign all contributions from the public, which can give a false sense of security to the unassuming user.
We will cover an exhaustive comparison of the supply chain strategies of other package management solutions elsewhere, but while many are pursuing reproducible builds, minimalism, or signing, there isn't currently another solution which delivers on all of these basic tenets of supply chain security. StageX is an attempt to fix this, in order to satisfy the criteria of reasonably secure supply chain strategy, which requires more than one individual to deterministically build and sign software.
Ask yourself the following: do I have a way of verifying that this binary was produced based on this source code?
While software is often reviewed for security flaws, and sometimes provides signed releases, what is missing is the ability to prove that the resulting binary is the direct result of that code and nothing has been modified along the way. To achieve this, we have to make the software always build the exact same thing, down to the last bit. More precisely, we distinguish three properties: a build is hermetic if its inputs are hash-locked with no network access or external influences; it is deterministic if it always produces bit-for-bit identical output; and it is reproducible if it can produce deterministic artifacts across different systems and hardware. You may be reading this and thinking "of course it should always build to the same exact binary", but this is usually not the case - it's highly unlikely that any of the software you have ever built is deterministic. By forcing software to always produce the same binary, we can use hashes to easily verify nothing has been modified and no new code has been introduced to the software during compilation. This is a significant security improvement, but it's not enough for only one individual to build something deterministically as they could be compromised - the real guarantee comes from multiple individuals compiling the software using different setups and still getting the same hashes. This gives us multiple points of reference, which we can use to figure out if the integrity of the software is truly in tact.
To develop a further intuition about the distinction between trusting source code and trusting what the compiler translates that source code to, you may refer to the seminal paper by Ken Thomson, Reflections on Trusting Trust
A comparison of StageX to other distros in some of the areas we care about:
| Distribution | Signers | OCI | Language | Bootstrapped | Reproducible | Toolchain | C Library | Allocator |
|---|---|---|---|---|---|---|---|---|
| StageX | 2 | Native | Containerfile | Yes | Yes | LLVM | musl | mimalloc |
| Guix | 1 | Exported | Scheme | Yes | Mostly | GNU | glibc | glibc |
| Arch | 1 | Published | Shell | No | Mostly | GNU | glibc | glibc |
| Debian | 1 | Published | Custom | No | Mostly | GNU | glibc | glibc |
| Alpine | 1 | Published | Shell | No | No | GNU | musl | mallocng |
| NixOS | 0 | Exported | Custom | Partial | Mostly | GNU | glibc | glibc |
| Buildroot | 0 | Exported | Makefile | No | No | GNU | glibc | glibc |
| Chimera | 0 | Published | Python | No | No | LLVM | musl | mimalloc |
| Wolfi | 0 | Native | YAML | Partial | No | GNU | glibc | glibc |
| Yocto | 0 | Exported | Custom | No | No | GNU | glibc | glibc |
Table is ordered by objective supply chain security metrics: “Signers”, “Bootstrapped”, and “Reproducible”.
The only way to produce trustworthy packages is to make sure no single system or human is ever trusted in the process of compiling them. Everything we release must be built deterministically. Further to avoid trusting any specific distro or platform, we must be able to reproduce even from wildly different toolchains, architectures, kernels, etc.
Using OCI container images as our base packaging system helps a lot here by making it easy to throw away non-deterministic build stages and control many aspects of the build environment. Also, as a well documented spec, it allows our packages to (ideally) be built with totally different OCI toolchains such as Docker, Podman, Kaniko, or Buildah.
This is only part of the story though, because being able to build deterministically means the compilers that compile our code themselves must be bootstrapped all the way from source code in a deterministic way.
For further reading, see the Bootstrappable Builds Project.
An OCI building runtime
containerd support is requiredGnu Make
make
make rust
make NOCACHE=1
Do this after successfully reproducing all packages and stages:
make sign
StageX: Eliminating Single Points of Failure in Linux Distributions
SoK: Analysis of Software Supply Chain Security by Establishing Secure Design Properties
A Review of Attacks Against Language-Based Package Managers
Software supply chain: review of attacks, risk assessment strategies and security controls
What is Software Supply Chain Security
An Industry Interview Study of Software Signing for Supply Chain Security
Journey to the Center of Software Supply Chain Attacks
SoK: A Defense-Oriented Evaluation of Software Supply Chain Security
S3C2 Summit 2023-02: Industry Secure Supply Chain Summit
An Integrity-Focused Threat Model for Software Development Pipelines
Dirty-Waters: Detecting Software Supply Chain Smells
A Systematic Literature Review on Trust in the Software Ecosystem
Backstabber's Knife Collection: A Review of Open Source Software Supply Chain Attacks
Reproducible Builds: Increasing the Integrity of Software Supply Chains
Reproducibility of Build Environments through Space and Time
Levels of Binary Equivalence for the Comparison of Binaries from Alternative Builds
Reproducible and User-Controlled Software Environments in HPC with Guix
(top 30 of 37)
Dockerfile
85.6%
Python
6.1%
Shell
4.9%
PHP
1.5%
Roff
1.1%
Mirror of Stagex. File issues and make PRs to https://codeberg.org/stagex/stagex
Dockerfile
1
2,236 commits
updated Sep 20, 2026
git://codeberg.org:stagex/stagex | matrix://#stagex:matrix.org | ircs://irc.oftc.net:6697#stagex
Minimalism and security first repository of reproducible and multi-signed OCI images of common open source software toolchains full-source bootstrapped from Stage 0 all the way up.
If you want to build or deploy software on a foundation of minimalism and determinism with reasonable security, StageX might be the solution you are looking for.
You can do anything with these images you would with almost any other musl based containerized Linux distro, only with high supply chain integrity and determinism.
For a full list of images see the "packages" directory or check our website
docker run -it stagex/stage3
docker run -it stagex/pallet-python -c "print('hello, world!')"
FROM stagex/pallet-rust AS build
RUN ["cargo", "new", "--bin", "pattern_matcher"]
WORKDIR /pattern_matcher
RUN ["cargo", "add", "regex"]
COPY <<-EOF /pattern_matcher/src/main.rs
use regex::Regex;
fn main() {
let mut args = std::env::args();
args.next();
let pattern = args.next().expect("pattern not given");
let text = args.next().expect("text to match not given");
let re = Regex::new(&pattern).expect("given pattern is invalid regex");
if let Some(r#match) = re.find(&text) {
println!("Found match: {match:?}");
}
}
EOF
ENV RUSTFLAGS="-C target-feature=+crt-static"
RUN ["cargo", "build", "--release"]
FROM stagex/core-filesystem AS package
COPY --from=build /pattern_matcher/target/release/pattern_matcher /usr/bin/pattern_matcher
ENTRYPOINT ["/usr/bin/pattern_matcher"]
Note the difference between the "build" and the final image: build has to
pull the rust pallet, which includes just the binaries required to build a
Rust program, but the final OCI image only contains the statically compiled
Rust binary, and is tiny as a result.
Oftentimes, you'll need dependencies that aren't included by default, such as
clang when building crates using Rust's bindgen crate. StageX makes adding
packages super simple. In your build phase, add the following line:
COPY --from=stagex/core-clang . /
No RUN commands needed.
Unlike most Linux distros, StageX adopts an OCI-first design: Open Container Initiative (OCI) images are the native packaging system, not just a distribution format. This means system components are immutable, pre-built container images that are constructed, signed, and verified outside the runtime environment. During installation, no arbitrary scripts are run. Image verification and unpacking are the primary operations, significantly reducing the attack surface.
StageX packages things in the most "stock" way possible, with exceptions only to maintain determinism.
Every image is "from scratch" and contains an empty filesystem with the installed package. Because StageX images comply with OCI specifications, they run without modification across Docker, Podman, containerd, and any other compliant runtime, reducing single points of failure in the runtime layer. Distribution is handled through established tooling (skopeo, oras) with built-in support for security hardening, sandboxing, and provenance tracking. Immutable images facilitate atomic upgrades and rollbacks, enhancing operational stability.
By default you always get the latest updates to dependencies on the fly, but you retain the option for bit-for-bit reproducible builds by locking any given dependency at a particular tag or image hash.
This allows you to use the version you need regardless of the situation without resorting to low security "curl | bash" style solutions.
Please keep in mind that even though we provide older versions of packages usually indicated by the number after the package (such as llvm21) we maintain a rolling release approach and only provide them for backwards compatibility. These can be removed at any time without previous notice.
We built StageX to satisfy high-assurance threat models where trusting any single system or maintainer in the software supply chain cannot be tolerated. Our design enforces strict verifiability across five core criteria, making StageX the first Linux distribution to integrate all of the following into a unified, self-consistent model. See our whitepaper for the formal analysis.
We have learned a lot of lessons about supply chain integrity over the years, and the greatest of them may be that any system that is complex to review and assigns trust of significant components to single individuals, which creates significant points of failure, will lead to eventual compromise.
Distros (Linux distributions) rely on complex package management systems for which only a single implementation exists. They typically generate a lot of custom tooling, which in turn rapidly grows in complexity to meet demands ranging from hobby desktops to production servers. This complexity demands a lot of effort to maintain, and in practice results in a tendency to reduce security overhead in order to lower the barrier to entry to attract more maintainers. As a result, projects rarely mandate cryptographic signing or reproducible builds, let alone multiple signed reproduction proofs. In fact, some popular distros use a server to blindly sign all contributions from the public, which can give a false sense of security to the unassuming user.
We will cover an exhaustive comparison of the supply chain strategies of other package management solutions elsewhere, but while many are pursuing reproducible builds, minimalism, or signing, there isn't currently another solution which delivers on all of these basic tenets of supply chain security. StageX is an attempt to fix this, in order to satisfy the criteria of reasonably secure supply chain strategy, which requires more than one individual to deterministically build and sign software.
Ask yourself the following: do I have a way of verifying that this binary was produced based on this source code?
While software is often reviewed for security flaws, and sometimes provides signed releases, what is missing is the ability to prove that the resulting binary is the direct result of that code and nothing has been modified along the way. To achieve this, we have to make the software always build the exact same thing, down to the last bit. More precisely, we distinguish three properties: a build is hermetic if its inputs are hash-locked with no network access or external influences; it is deterministic if it always produces bit-for-bit identical output; and it is reproducible if it can produce deterministic artifacts across different systems and hardware. You may be reading this and thinking "of course it should always build to the same exact binary", but this is usually not the case - it's highly unlikely that any of the software you have ever built is deterministic. By forcing software to always produce the same binary, we can use hashes to easily verify nothing has been modified and no new code has been introduced to the software during compilation. This is a significant security improvement, but it's not enough for only one individual to build something deterministically as they could be compromised - the real guarantee comes from multiple individuals compiling the software using different setups and still getting the same hashes. This gives us multiple points of reference, which we can use to figure out if the integrity of the software is truly in tact.
To develop a further intuition about the distinction between trusting source code and trusting what the compiler translates that source code to, you may refer to the seminal paper by Ken Thomson, Reflections on Trusting Trust
A comparison of StageX to other distros in some of the areas we care about:
| Distribution | Signers | OCI | Language | Bootstrapped | Reproducible | Toolchain | C Library | Allocator |
|---|---|---|---|---|---|---|---|---|
| StageX | 2 | Native | Containerfile | Yes | Yes | LLVM | musl | mimalloc |
| Guix | 1 | Exported | Scheme | Yes | Mostly | GNU | glibc | glibc |
| Arch | 1 | Published | Shell | No | Mostly | GNU | glibc | glibc |
| Debian | 1 | Published | Custom | No | Mostly | GNU | glibc | glibc |
| Alpine | 1 | Published | Shell | No | No | GNU | musl | mallocng |
| NixOS | 0 | Exported | Custom | Partial | Mostly | GNU | glibc | glibc |
| Buildroot | 0 | Exported | Makefile | No | No | GNU | glibc | glibc |
| Chimera | 0 | Published | Python | No | No | LLVM | musl | mimalloc |
| Wolfi | 0 | Native | YAML | Partial | No | GNU | glibc | glibc |
| Yocto | 0 | Exported | Custom | No | No | GNU | glibc | glibc |
Table is ordered by objective supply chain security metrics: “Signers”, “Bootstrapped”, and “Reproducible”.
The only way to produce trustworthy packages is to make sure no single system or human is ever trusted in the process of compiling them. Everything we release must be built deterministically. Further to avoid trusting any specific distro or platform, we must be able to reproduce even from wildly different toolchains, architectures, kernels, etc.
Using OCI container images as our base packaging system helps a lot here by making it easy to throw away non-deterministic build stages and control many aspects of the build environment. Also, as a well documented spec, it allows our packages to (ideally) be built with totally different OCI toolchains such as Docker, Podman, Kaniko, or Buildah.
This is only part of the story though, because being able to build deterministically means the compilers that compile our code themselves must be bootstrapped all the way from source code in a deterministic way.
For further reading, see the Bootstrappable Builds Project.
An OCI building runtime
containerd support is requiredGnu Make
make
make rust
make NOCACHE=1
Do this after successfully reproducing all packages and stages:
make sign
StageX: Eliminating Single Points of Failure in Linux Distributions
SoK: Analysis of Software Supply Chain Security by Establishing Secure Design Properties
A Review of Attacks Against Language-Based Package Managers
Software supply chain: review of attacks, risk assessment strategies and security controls
What is Software Supply Chain Security
An Industry Interview Study of Software Signing for Supply Chain Security
Journey to the Center of Software Supply Chain Attacks
SoK: A Defense-Oriented Evaluation of Software Supply Chain Security
S3C2 Summit 2023-02: Industry Secure Supply Chain Summit
An Integrity-Focused Threat Model for Software Development Pipelines
Dirty-Waters: Detecting Software Supply Chain Smells
A Systematic Literature Review on Trust in the Software Ecosystem
Backstabber's Knife Collection: A Review of Open Source Software Supply Chain Attacks
Reproducible Builds: Increasing the Integrity of Software Supply Chains
Reproducibility of Build Environments through Space and Time
Levels of Binary Equivalence for the Comparison of Binaries from Alternative Builds
Reproducible and User-Controlled Software Environments in HPC with Guix
(top 30 of 37)
Dockerfile
85.6%
Python
6.1%
Shell
4.9%
PHP
1.5%
Roff
1.1%