News for hackers. Stuff that matters.
Re:Using Nix with Dockerfiles by dan0000 on Monday April 24, 2023 @06:09PM (#35693941)
I think this is something the writer of the article would be delighted to find: https://github.com/railwayapp/nixpacks
Re:Using Nix with Dockerfiles by bfrog on Monday April 24, 2023 @07:59PM (#35694857)
I actually used nix in place of dockerfiles to build docker images, as it helped produce a perfectly minimal image for N architectures without much effort.
Re:Using Nix with Dockerfiles by rgoulter on Monday April 24, 2023 @11:53PM (#35696345)
Could you elaborate?

How much effort had to go into the Nix expression to make the image smaller, compared to what you'd do with a Dockerfile?

I'm guessing you / your team is otherwise already familiar with Nix?

Re:Using Nix with Dockerfiles by bfrog on Wednesday April 26, 2023 @05:19PM (#35720161)
It was near effortless, using the nix dockerTools. The hard part was packaging up all the horrible C++ dependencies involved.

I followed the guide here

https://nixos.org/guides/building-and-running-docker-images....

I ended up with an expression that built an image with my program that took the arch as a parameter.

You can see it here

https://github.com/openenergysolutions/openfmb.adapters/blob... and dig in if you like.

Re:Using Nix with Dockerfiles by rgoulter on Monday April 24, 2023 @11:59PM (#35696365)
> Use a Dockerfile and the official Nix image to build your application using Nix using roughly one shell command.

I'd misread the title, & thought this would be about using nixpkgs' dockerTools.

https://nix.dev/tutorials/building-and-running-docker-images

I would assume that the resulting image is about the same, but you wouldn't need a bespoke Dockerfile. The downsides being that you'd need to know nix to maintain it (which you would anyway with this approach), and you'd need `nix` rather than `docker` to build the image.

Re:Using Nix with Dockerfiles by 3836293648 on Tuesday April 25, 2023 @08:54AM (#35699791)
> I'm serious, I haven't had a "works on my machine [but not on others]" issue in years. Not a single one.

Clearly you haven't touched OpenGL. Nix apps on non-nixos need a wrapper to use OpenGL and what's worse is that you need a different wrapper for each GPU vendor