3 ms·
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 xe
by xena 7y ago
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!
- asdf-asdf-asdf 7y agoso, 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?
- xena 7y agoThe 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 https://github.com/Xe/site/blob/master/Dockerfile) but that won't cover ca-certificates generically.