Hacker News new | ask | show | jobs
by seiferteric 4067 days ago
Somewhat unrelated. Is there a way to ship a container image with just a "diff" of the default image. Say I build a container with ubuntu 14.04 + some packages installed with apt. I would like to be able to "export" the filesystem, but only the files that are not present in the base os image. The reason I would like this is that I would like to use docker (or systemd-nspawn) to run containers on an device that will not always have access to the internet. It would be nice to be able to add a new package to that device, and not be multi 100 MBs. As long as I can guarantee that the base image is present on the device, I should not need to include it in the image.
2 comments

You can hack this up yourself using the output from 'docker save'. 'save' produces a tarball which contains layers, and you can delete the layers from your 'save' tarball that you know you already have on the destination.
As long as you are pulling images from a docker registry, this should automatically happen.
Ya the point is it won't have access to a registry. I would like to be able to ship docker "packages" that have everything they need, but not have a lot of duplicate data (the base os image) in each package. I should be able to have the base image as its own package for example, and the other packages just have the "diff" files that they need.
Last I checked. Docker will pull a delta when resolving new containers, but will export the entire thing if you want something for offline usage.

I had the same question as OP and didn't find anything that works as he described it when I looked 6+ months ago.