Optimising Docker Layers for Better Caching with Nix
11–14 of 14 posts
Re: Optimising Docker Layers for Better Caching with Nix
#12Neat. It seems like Nix could become the preferred way to build Docker images, if it's made a bit more user friendly. It's hard to beat the simplicity of FROM ubuntu:latest RUN apt-get update RUN apt-get install -y mysql php
"Simplest" can be subjective. There's not much that can compete with editing your nixos config file and adding services.mattermost.enable = true; and then running # nixos-rebuild switch to have a mattermost instance running.
Re: Optimising Docker Layers for Better Caching with Nix
#13I really like this. I think it is a great compromise between the limitations of docker and everything packaged in one file while taking advantage of nix. I'm curious about one other optimization that could be made. You could instead look at the dependency graph of several nix docker builds and increase the cache reuse even more from that.
"Where before you wouldn’t bother trying to have your application and database images share layers, with Nix the layer sharing is completely automatic."
Re: Optimising Docker Layers for Better Caching with Nix
#14Nix and Docker integration is almost optimal now, no other tooling provides that type of functionality
[Habitat]( http://habitat.sh/ ) builds on the concepts in Nix, and here is a relatively old experiment I found on optimizing Docker layering with it: https://github.com/chetan/habitat-dockerize-layers