• 4 Posts
  • 513 Comments
Joined 2 years ago
cake
Cake day: July 19th, 2023

help-circle









  • I might just start bundling my apps inside an environment setup with nix inside docker. A lot of them are similar to identical, So those docker images actually share a lot of layers under the hood.

    My apps after compiling and packaging are usually around 50mb. That’s 48mb of debian, which is entirely shared between all the images that I build. So the eventual size of my deployed applications isn’t nearly as big as they seem from the size of the tarball being sent around. So for 10 apps, that’s not 500mb, that’s 68mb.

    If anything, the docker hub and registry are a bit of a mess.


  • you can trust the nix repositories aren’t going to change

    That, I do not. And storing the source and such for every dependency would be bigger than, and result in essentially the same thing as an image.

    I think you’re trying to achieve something different than what docker is for. Docker is like installing onto an empty computer then shipping the entire machine to the end user. You pretty much guarantee thing will work. (yes this is oversimplified)


  • The issue is, nix builds are only guaranteed to be reproducible if the dependencies don’t change. Which they shouldn’t, but you can’t trust the internet to be consistent. Things won’t be there to be fetched forever.

    Images do. And you can turn one into a container in seconds. I suppose it’s a matter of preference. I like one a package to be independent







  • Hold up, nix added containerization? How did I miss that? I will have another look now!

    Also, you’re right. For small quick scripts docker can be a hassle. Nowadays though I add building a docker image as part of my project’s build/compilation process. The main reason I do this is so that I can work with whatever machine I happen to be on, then just copy paste the app to whatever machine I want it on. No extra config or even a look at the environment required. Just install docker and forget about the rest

    update: installing docker on nixos (on a vm) with a nix package failed, not sure why. Perhaps some dependencies were no longer available?

    update: nix is is available as a docker image. I’m running it now, we shall see how it goes