bundlers VS nix2container

Compare bundlers vs nix2container and see what are their differences.

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
bundlers nix2container
3 9
90 453
- -
2.8 6.3
7 months ago 2 days ago
Nix Go
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

bundlers

Posts with mentions or reviews of bundlers. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-26.
  • The Magic Nix Cache
    9 projects | news.ycombinator.com | 26 Jun 2023
    - the caching works across branches, so for example merging a feature branch to master, if nothing changes the build on master will be very quick

    I created something similar to nix-cache for gitlab, but I had to create a dedicated runner running NixOS.

    If I could use NixOS for deployment, at that point I would just point the same binary cache to the machine and use the same derivation to build the app. Because the app was already build by CI, it would just download the compiled version. No need for artifactory or similar. In that scenario (you using poetry) you probably would just use poetry2nix to generate the application.

    If the OS is not NixOS, but you still want to deploy via nix, then IMO this[2] looks interesting, basically it packages everything in self extracting archive. That you can extract and then run the app.

    Other alternatives are these bundlers[3], which includes building toArx (works in a way similar to the previous one but pretends everything is in a single file), RPM, DEB, docker (you would have more control over it if you would use the code directly instead of a bundler though)

    And the last option (probably the most obvious one) is that you can simply just use the tool to build the package. Since you're using poetry, then you can generate a wheel from it.

    [1] https://github.com/takeda/nix-cde/blob/master/contrib/gitlab...

    [2] https://github.com/Ninlives/relocatable.nix

    [3] https://github.com/NixOS/bundlers/blob/master/flake.nix

  • After 20 years are developers now ready for Nix?
    1 project | news.ycombinator.com | 2 Mar 2023
    We've seen the opposite. New package managers are built with a much better understanding of the problem space because of Nix and sometimes explicitly taking ideas and concepts. This results in those new systems being far more compatible and easily integrated with Nix itself. Consider the iteration towards better and better locking in python + Node. Consider Rust/Cargo.

    There has also been sharing of ideas and collaboration between things us and bazel/buck/spack/etc. I think it is clear that we are all moving towards a similar end state, that often looks very much like Nix, or a re-invention of it.

    For things like OCI, Nix predates it, but we should start to re-use the standard. The Tvix group is exploring this and I'd suspect our sandboxing will be OCI at some point. For outputs; we make it easy to convert a Nix package into an equivalent container. Things like flatpack,AppImage,Snap should also be easy for people to output (i'm trying to collect these "transformers"/"bundlers" here: https://github.com/NixOS/bundlers).

  • Nixpacks takes a source directory and produces an OCI compliant image
    7 projects | news.ycombinator.com | 17 Aug 2022
    Nix 3 has a dead simple, builtin CLI frontend for built packages: https://nixos.org/manual/nix/unstable/command-ref/new-cli/ni...

    It uses dockerTools: https://github.com/NixOS/bundlers/blob/master/flake.nix

    maybe a bundler can be added that uses OCI tools, thus providing such a wrapper and giving a nice CLI for it

nix2container

Posts with mentions or reviews of nix2container. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-15.
  • Nix is a better Docker image builder than Docker's image builder
    21 projects | news.ycombinator.com | 15 Mar 2024
    No discussion about Nix-built containers is complete with nix2container:

    https://github.com/nlewo/nix2container

    It is truly magical for handling large, multi-layered containers. Instead of building the container archives themselves and storing them in the nix store, it builds a JSON manifest that is consumed by a lightly patched version of skopeo that streams the layers directly to either your local container engine or the registry.

    This means you never rebuild or reupload a container layer that is unchanged.

  • Way to get NVM working in CI/CD systems
    6 projects | news.ycombinator.com | 19 May 2023
    - Container images are built with https://github.com/nlewo/nix2container instead of Nix's built-in docker tools, because nix2container allows configuration of layers and thus makes it easier to share layers between images and improve layer caching.

    As for integrating it into our CI pipeline, this is pretty much CI system agnostic as all you have to do is run `nix build ...` inside the pipeline, generating a `result` directory or file as an artifact that, in the case of nix2container, can be pushed to your container image registry.

  • How do I create a docker image for postgres with nix?
    4 projects | /r/NixOS | 10 Mar 2023
    dockerTools is the canonical way, but https://github.com/nlewo/nix2container seems to be gaining support as it's faster and doesn't use so much disk space while building.
  • We deploy 5X faster with warm Docker containers
    3 projects | news.ycombinator.com | 7 Mar 2023
    > The key factor behind our decision was the realization that while Docker images are industry standard, moving around 100s of megabytes of images seems unnecessarily heavy-handed when we just need to synchronize a small change.

    I think the culprit is more the GitHub Actions cache than Docker since it seems to be hard to get a clean cache management. I'm not sure about caching Docker image layers, but caching the Nix store with GitHub Actions is pretty complicated (not even sure it's possible): this means we have to download all required Nix store paths on each run, but i consider this is because of a GitHub Action cache limitation.

    So, did you consider using another CI, which offers better caching mechanisms?

    With a CI able to preserve the Nix store (Hydra[1] or Hercules[2] for instance), I think nix2container (author here) could also fit almost all of your requirements ("composability", reproducibility, isolation) and maybe provide better performances because it is able to split your application into several layers [2][3].

    Note i'm pretty sure a lot of Docker CI also allows to efficiently build Docker images.

    [1] https://hercules-ci.com/

    [2] https://grahamc.com/blog/nix-and-layered-docker-images

    [3] https://github.com/nlewo/nix2container/blob/85670cab354f7df6...

  • Launch HN: Depot (YC W23) – Fast Docker Images in the Cloud
    6 projects | news.ycombinator.com | 22 Feb 2023
    FYI, the nix2container [1] project (author here) aims to speedup the standard Nix container workflow (dockerTools.buildImage) by basically skipping the tarball step: it directly streams non already pushed layers.

    [1] https://github.com/nlewo/nix2container

  • Crafting container images without Dockerfiles
    20 projects | news.ycombinator.com | 6 Feb 2023
    To get Rust incremental builds, did you consider using something such as crane https://github.com/ipetkov/crane ?

    And regarding OCI images, i built nix2container (https://github.com/nlewo/nix2container) to speed up image build and push times.

  • Optimising Docker Layers for Better Caching with Nix (2018)
    2 projects | news.ycombinator.com | 11 Sep 2022
    For a more modern iteration of that idea, check out https://github.com/nlewo/nix2container

    It has all the benefits of OP but produces the images much faster, and with less on-disk usage.

  • Nixpacks takes a source directory and produces an OCI compliant image
    7 projects | news.ycombinator.com | 17 Aug 2022
    I've been using nix2container[1] for awhile now. It looks like this depends on Docker, have you guys considered removing that dependency? It shouldn't be necessary to create an OCI compliant image with Nix.

    [1]: https://github.com/nlewo/nix2container

  • Nixery – Docker images on the fly with Nix
    8 projects | news.ycombinator.com | 18 Apr 2022
    With https://github.com/nlewo/nix2container, I'm trying to make a more standalone tool. Basically, a Go binary takes a reference graph and produces a JSON file describing a container image. This JSON file is then ingested by a Skopeo fork (it adds a new `transport`) to produce images (to file, registries,...).

    Currently, it supports the dockerTools layering algorithm and is designed to work with Guix [1] as well;)

    [1] https://github.com/nlewo/nix2container/blob/065e5b108650ee4c...

What are some alternatives?

When comparing bundlers and nix2container you can also consider the following projects:

hasql-interpolate

naersk - Build Rust projects in Nix - no configuration, no code generation, no IFD, sandbox friendly.

relocatable.nix - A nix bundler that produces relocatable deployment script for nix store paths.

crate2nix - rebuild only changed crates in CI with crate2nix and nix

nixpkgs - Nix Packages collection & NixOS

nixpacks - App source + Nix packages + Docker = Image

stage0 - A set of minimal dependency bootstrap binaries

plane - A distributed system for running WebSocket services at scale.

Moby - The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

cargo2nix - Granular builds of Rust projects for Nix

buildah - A tool that facilitates building OCI images.

nixery - Container registry which transparently builds images using the Nix package manager. Canonical repository is https://cs.tvl.fyi/depot/-/tree/tools/nixery