{"action":"opened","issue":{"url":"https://api.github.com/repos/Linuturk/mono-choco/issues/3","repository_url":"https://api.github.com/repos/Linuturk/mono-choco","labels_url":"https://api.github.com/repos/Linuturk/mono-choco/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Linuturk/mono-choco/issues/3/comments","events_url":"https://api.github.com/repos/Linuturk/mono-choco/issues/3/events","html_url":"https://github.com/Linuturk/mono-choco/issues/3","id":263719441,"number":3,"title":"Turn Dockerfile into a multi-stage build","user":{"login":"philippgille","id":170670,"avatar_url":"https://avatars2.githubusercontent.com/u/170670?v=4","gravatar_id":"","url":"https://api.github.com/users/philippgille","html_url":"https://github.com/philippgille","followers_url":"https://api.github.com/users/philippgille/followers","following_url":"https://api.github.com/users/philippgille/following{/other_user}","gists_url":"https://api.github.com/users/philippgille/gists{/gist_id}","starred_url":"https://api.github.com/users/philippgille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philippgille/subscriptions","organizations_url":"https://api.github.com/users/philippgille/orgs","repos_url":"https://api.github.com/users/philippgille/repos","events_url":"https://api.github.com/users/philippgille/events{/privacy}","received_events_url":"https://api.github.com/users/philippgille/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-08T13:51:45Z","updated_at":"2017-10-08T13:51:45Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The [current Dockerfile](https://github.com/Linuturk/mono-choco/blob/df83b13a03ea77b70e00d8339cf9a503ec6531a4/Dockerfile) uses many image layers and also *builds* the `choco` executable in the same image that gets later used for *running* `choco`.\r\n\r\nSince [Docker 17.05.0-ce](https://docs.docker.com/release-notes/docker-ce/#17050-ce-2017-05-04) there are multi-stage builds, which enables building *two* (or more) Docker images within one Dockerfile, while only the last one will be used for distribution.\r\n\r\nThis is most useful for images where a static binary gets built (e.g. the first Docker image inherits from the 273 MB `golang`, building the static binary with Go, then the second Docker image inherits from the tiny `scratch` or 2 MB `alpine`, only adding the built binary from the previous image, making the image much smaller). But it's nice in other cases as well.\r\n\r\nSee [https://docs.docker.com/engine/userguide/eng-image/multistage-build/](https://docs.docker.com/engine/userguide/eng-image/multistage-build/).\r\n\r\nAlso, some `RUN` steps can be combined, leading to fewer image layers.\r\n\r\nI'm willing to create a PR for that if you don't mind."}}
{"actor":{"display_login":"philippgille"}}