-
Notifications
You must be signed in to change notification settings - Fork 142
Generated Docker images have a single layer #340
Comments
@andsens This is, right now, a mildly wild idea, in the sense that I didn't even check yet if very simple images build reproducibly (and if not, where the unreproducibility lies). However, I think reproducible builds would be a very powerful feature to have. I filed the issues so that other people may read it (and that I do not forget). |
That is a great idea. I love the concept of Still, this is definitely worth discussing :-) |
Exactly my point: Docker's caching mechanism is utterly unsafe/insane. |
You won't get the same ID, the timestamps of files change from run to run :-( |
@andsens Yes; as said originally, it will need work to make the phases deterministic.
|
Docker images constitute of several layers, filesystem overlays that are combined together to produce the actual image's filesystem. The rationale for doing this is two-fold:
debootstrap
ed Debian install can be common to multiple images) to save disk space (and cache).While 2. is not relevant (I think) for bootstrap-vz, 1. very likely is, and producing reuseable image layers would be great. However, the way Docker implements this (assuming that running the same command in the same layer produces the same result) has notorious issues and is likely not applicable here.
However, something that could be done is to run the build as usual (without Docker-style caching) and switch to a different layer at the end of a few phases, such as
os_installation
,package_installation
,system_modification
anduser_modification
.Provided that the installation of the same packages (in the same version and so on...) results in the same layer (in other words, provided that the layer builds reproducibly), then the image can share layers with other images that use the same debootstrap parameters, install the same packages, ...
Note that, unlike Docker's approach, this is safe: the worst that can happen is that no layer is common to several containers. The build is done in entirety, without any special assumption.
The text was updated successfully, but these errors were encountered: