{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/332","labels_url":"https://api.github.com/repos/docker/docker/issues/332/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/332/comments","events_url":"https://api.github.com/repos/docker/docker/issues/332/events","html_url":"https://github.com/docker/docker/issues/332","id":12789670,"number":332,"title":"flatten images - merge multiple layers into a single one","user":{"login":"unclejack","id":1409668,"avatar_url":"https://avatars.githubusercontent.com/u/1409668?v=3","gravatar_id":"","url":"https://api.github.com/users/unclejack","html_url":"https://github.com/unclejack","followers_url":"https://api.github.com/users/unclejack/followers","following_url":"https://api.github.com/users/unclejack/following{/other_user}","gists_url":"https://api.github.com/users/unclejack/gists{/gist_id}","starred_url":"https://api.github.com/users/unclejack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unclejack/subscriptions","organizations_url":"https://api.github.com/users/unclejack/orgs","repos_url":"https://api.github.com/users/unclejack/repos","events_url":"https://api.github.com/users/unclejack/events{/privacy}","received_events_url":"https://api.github.com/users/unclejack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/Distribution","name":"Distribution","color":"e11d21"},{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":173,"created_at":"2013-04-04T08:14:35Z","updated_at":"2015-05-06T09:20:13Z","closed_at":null,"body":"There's no way to flatten images right now. When performing a build in multiple steps, a few images can be generated and a larger number of layers is produced. When these are pushed to the registry, a lot of data and a large number of layers have to be downloaded.\r\n\r\nThere are some cases where one starts with a base image (or another image), changes some large files in one step, changes them again in the next and deletes them in the end. This means those files would be stored in 2 separate layers and deleted by whiteout files in the final image.\r\n\r\nThese intermediary layers aren't necessarily useful to others or to the final deployment system.\r\n\r\nImage flattening should work like this:\r\n- the history of the build steps needs to be preserved\r\n- the flattening can be done up to a target image (for example, up to a base image)\r\n- the flattening should also be allowed to be done completely (as if exporting the image)"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/99394622","html_url":"https://github.com/docker/docker/issues/332#issuecomment-99394622","issue_url":"https://api.github.com/repos/docker/docker/issues/332","id":99394622,"user":{"login":"muayyad-alsadi","id":1312683,"avatar_url":"https://avatars.githubusercontent.com/u/1312683?v=3","gravatar_id":"","url":"https://api.github.com/users/muayyad-alsadi","html_url":"https://github.com/muayyad-alsadi","followers_url":"https://api.github.com/users/muayyad-alsadi/followers","following_url":"https://api.github.com/users/muayyad-alsadi/following{/other_user}","gists_url":"https://api.github.com/users/muayyad-alsadi/gists{/gist_id}","starred_url":"https://api.github.com/users/muayyad-alsadi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muayyad-alsadi/subscriptions","organizations_url":"https://api.github.com/users/muayyad-alsadi/orgs","repos_url":"https://api.github.com/users/muayyad-alsadi/repos","events_url":"https://api.github.com/users/muayyad-alsadi/events{/privacy}","received_events_url":"https://api.github.com/users/muayyad-alsadi/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T09:20:13Z","updated_at":"2015-05-06T09:20:13Z","body":"Yes it does fulfill. Is it more elegant? I'm not sure because this way the\nmeaning of \"commit\" is overloaded with an implied condition. And explicit\nis better than implicit. If some sort of include feature got introduced I\nwon't be able to see if there is commit in them or not.\n\nOn Wed, May 6, 2015, 12:56 AM Brandon R. Stoner <notifications@github.com>\nwrote:\n\n> @muayyad-alsadi <https://github.com/muayyad-alsadi> Wouldn't this fulfill\n> your request more elegantly?\n>\n> ADD PRIVATEKEYRUN git clone ...RUN rm PRIVATEKEYRUN rm -rf .gitRUN makeRUN find . -name '*.o'\n> COMMIT # Nothing commits until the first COMMIT when a COMMIT is present\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/docker/docker/issues/332#issuecomment-99234500>.\n>\n"}}