Hacker News new | ask | show | jobs
by techdragon 1991 days ago
Has the container situation improved? Last time I looked (quite some time ago) I couldn’t find an official or community blessed container to base anything on.
3 comments

Nix supports containers as a build target or output format, but the nix tools are considerate (easy to uninstall) so there's no need (& little sense) in putting them in a container. You could run the nix install script in a ubuntu or alpine image.

I use Nix on macOS, wishing I could replace all my brew usage with it. Working on a home-manager derived setup.

The dev workflow mentioned by tikhonj https://christine.website/blog/how-i-start-nix-2020-03-08 (including a "derivation" building a container from the example project).

https://nixos.org/guides/nix-pills/

A nix derivation can be converted directly into a docker image, you don't need a docker file at all. It's actually very simple and quite intuitive.

I wrote a blog post about doing this with python, but it's straightforward to generalise.

https://sotelo.dev/blog/nix-for-pythonistas

I've used the nixos/nix image from Docker Hub[1] to run some CI scripts using Nix to build my projects.

As far as I understand it, it's basically Alpine Linux with the Nix package manager and tools preinstalled, but it worked pretty well for me.

[1]: https://hub.docker.com/r/nixos/nix/

This is the sort of thing I was looking for. There may not be much too it, (and as another comment mentioned, the package management tools can output containers) but having a blessed starting point shows a clear signal to potential user that it's not just an afterthought.