Skip to content

Comment on The Flox Open Beta

Comments

I know that this has been asked in past threads but I would love to understand how Nix compares to containers and on top of that what does flox provide in it's comparison to containers?

Nix and flox will give you:

1. A more reproducible environment thanks to nix determinism 2. A more widely re-usable base approach in the form of environments vs containers

with flox, you can develop software in a development environment that matches the way the software will be packaged. Then, you can distribute this software so that someone can just run "flox install" on Mac, Linux, Windos WSL2, or it can be loaded into a docker container image and deployed that way.

hypothetical Dockerfile:

    FROM python
    FROM nodejs
    RUN sh -c 'python ... | node ...'
Imagine this Dockerfile being valid. We want to express the idea of composing these two images into one and using binaries from both. Consider that those might have conflicting /usr/lib contents?! This is easy with flox+nix because that conflict doesn't happen.

There are other benefits such as: - minimal containers - automatic extraction of artifacts and their runtime-dependencies - no more pushing your compilers into prod - no cleaning steps (apt-cache clean) - declarative - reproducible - more fun!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.