A Nix-based tool for building container images efficiently without writing tarballs to the Nix store and enabling layer reuse.
nix2container is a Nix library for building container images efficiently. It implements an archive-less alternative to dockerTools.buildImage, avoiding tarball writes to the Nix store and enabling layer reuse. This solves the problem of slow rebuild and push cycles in container development workflows.
Nix users and DevOps engineers who build container images with Nix and want faster iteration times. It's particularly useful for teams using Nix in CI/CD pipelines for container deployment.
Developers choose nix2container for its significant speed improvements in rebuild and push cycles compared to traditional dockerTools methods. Its unique selling point is the ability to skip already pushed layers without rebuilding them, reducing both build time and network usage.
An archive-less dockerTools.buildImage implementation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Avoids writing intermediate tarballs to the Nix store, reducing storage overhead and speeding up image construction by eliminating redundant I/O operations.
Skips already pushed layers without rebuilding them, significantly cutting push times in CI/CD pipelines, as demonstrated in the quick benchmarks with ~1.8s rebuild/repush cycles.
Allows isolating dependencies in dedicated layers via the layers attribute, enabling better caching and incremental updates for faster iterations.
Produces images conforming to the OCI image specification, ensuring compatibility with standard container runtimes like Docker and Podman.
Requires manual steps like copying Docker configs, setting file permissions, and binding mounts in the Nix sandbox for registry auth, which is error-prone and not automated.
Lacks seamless support for Docker ecosystem tools; for example, full functionality depends on a custom Skopeo branch, and integration with orchestration tools isn't covered.
Tests cannot run in the Nix sandbox due to container runtime restrictions, potentially affecting reproducibility and reliability in isolated environments.