{"action":"opened","issue":{"url":"https://api.github.com/repos/andsens/bootstrap-vz/issues/340","repository_url":"https://api.github.com/repos/andsens/bootstrap-vz","labels_url":"https://api.github.com/repos/andsens/bootstrap-vz/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/andsens/bootstrap-vz/issues/340/comments","events_url":"https://api.github.com/repos/andsens/bootstrap-vz/issues/340/events","html_url":"https://github.com/andsens/bootstrap-vz/issues/340","id":176273891,"number":340,"title":"Generated Docker images have a single layer","user":{"login":"nbraud","id":1155801,"avatar_url":"https://avatars.githubusercontent.com/u/1155801?v=3","gravatar_id":"","url":"https://api.github.com/users/nbraud","html_url":"https://github.com/nbraud","followers_url":"https://api.github.com/users/nbraud/followers","following_url":"https://api.github.com/users/nbraud/following{/other_user}","gists_url":"https://api.github.com/users/nbraud/gists{/gist_id}","starred_url":"https://api.github.com/users/nbraud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbraud/subscriptions","organizations_url":"https://api.github.com/users/nbraud/orgs","repos_url":"https://api.github.com/users/nbraud/repos","events_url":"https://api.github.com/users/nbraud/events{/privacy}","received_events_url":"https://api.github.com/users/nbraud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-12T00:15:28Z","updated_at":"2016-09-12T00:15:28Z","closed_at":null,"body":"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:\r\n\r\n1. Multiple images can share layers (say, a bare `debootstrap`ed Debian install can be common to multiple images) to save disk space (and cache).\r\n2. Layers are an integral part of how Docker lets you reuse images by slapping more customizations on top.\r\n\r\nWhile 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](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#apt-get) and is likely not applicable here.\r\n\r\nHowever, 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` and `user_modification`.\r\nProvided 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, ..."}}
{"actor":{"display_login":"nbraud"}}