News for hackers. Stuff that matters.
Re:My NixOS Desktop Flow by xena on Sunday April 26, 2020 @06:42AM (#22986151)
I mainly nix-ified my blog build to make a docker image that is as small as possible.

Compare my super-optimised dockerfile results:

$ docker images | grep xena xena/christinewebsite latest eb8c27a1a5d2 12 seconds ago 121MB

To the naiive nix results:

$ docker images | grep xena xena/christinewebsite latest b087ad7fb924 50 years ago 102MB

This image ends up only including my blog (statically compiled), ca certificates (because of the patreon integration), time zone data files (because of the go time package), iana port numbers (something to do with the go net package) and mailcap (for some reason). It's puny!

Re:My NixOS Desktop Flow by asdf-asdf-asdf on Sunday April 26, 2020 @08:53AM (#22986791)
so, what makes up the 19MB difference? (i assume it's not caused by the nix one being MUCH older :-)

couldn't you simply do a multi-stage docker-image (in the not-nix situation),where you just copy over the go binary into the final docker-image, and add the needed files?

Re:My NixOS Desktop Flow by xena on Sunday April 26, 2020 @10:51AM (#22987537)
The 19 MB difference is alpine linux crud, musl and other base things in my custom docker base image.

In theory I could do the multi-stage docker approach to get an as-tiny-as-possible setup (and I actually do this: https://github.com/Xe/site/blob/master/Dockerfile) but that won't cover ca-certificates generically.