{"action":"created","issue":{"url":"https://api.github.com/repos/tootsuite/mastodon/issues/3508","repository_url":"https://api.github.com/repos/tootsuite/mastodon","labels_url":"https://api.github.com/repos/tootsuite/mastodon/issues/3508/labels{/name}","comments_url":"https://api.github.com/repos/tootsuite/mastodon/issues/3508/comments","events_url":"https://api.github.com/repos/tootsuite/mastodon/issues/3508/events","html_url":"https://github.com/tootsuite/mastodon/pull/3508","id":233032368,"number":3508,"title":"Docker: Smaller image, remove build dependencies","user":{"login":"maur1th","id":5855076,"avatar_url":"https://avatars1.githubusercontent.com/u/5855076?v=3","gravatar_id":"","url":"https://api.github.com/users/maur1th","html_url":"https://github.com/maur1th","followers_url":"https://api.github.com/users/maur1th/followers","following_url":"https://api.github.com/users/maur1th/following{/other_user}","gists_url":"https://api.github.com/users/maur1th/gists{/gist_id}","starred_url":"https://api.github.com/users/maur1th/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maur1th/subscriptions","organizations_url":"https://api.github.com/users/maur1th/orgs","repos_url":"https://api.github.com/users/maur1th/repos","events_url":"https://api.github.com/users/maur1th/events{/privacy}","received_events_url":"https://api.github.com/users/maur1th/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-01T22:50:35Z","updated_at":"2017-06-02T01:36:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tootsuite/mastodon/pulls/3508","html_url":"https://github.com/tootsuite/mastodon/pull/3508","diff_url":"https://github.com/tootsuite/mastodon/pull/3508.diff","patch_url":"https://github.com/tootsuite/mastodon/pull/3508.patch"},"body":"I noticed build-dependencies weren't removed from the the image although a virtual package was created (`apk add -t build-dependencies`). Not sure why and I couldn't find mention of that in the PR where it was introduced (https://github.com/tootsuite/mastodon/pull/3182). So I \"fixed\" it (`apk del --no-cache build-dependencies`) and split the `apk add RUN` instruction to better leverage build caching following this change.\r\n\r\nImage size goes down from 1.41GB to 1.22GB and no more build tools are included in production containers.\r\n\r\nI also removed `rm -rf /tmp/* /var/cache/apk/*` because those folders are empty (well, almost: 3 4KB files in /tmp/) at this point."},"comment":{"url":"https://api.github.com/repos/tootsuite/mastodon/issues/comments/305665413","html_url":"https://github.com/tootsuite/mastodon/pull/3508#issuecomment-305665413","issue_url":"https://api.github.com/repos/tootsuite/mastodon/issues/3508","id":305665413,"user":{"login":"Gargron","id":184731,"avatar_url":"https://avatars0.githubusercontent.com/u/184731?v=3","gravatar_id":"","url":"https://api.github.com/users/Gargron","html_url":"https://github.com/Gargron","followers_url":"https://api.github.com/users/Gargron/followers","following_url":"https://api.github.com/users/Gargron/following{/other_user}","gists_url":"https://api.github.com/users/Gargron/gists{/gist_id}","starred_url":"https://api.github.com/users/Gargron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gargron/subscriptions","organizations_url":"https://api.github.com/users/Gargron/orgs","repos_url":"https://api.github.com/users/Gargron/repos","events_url":"https://api.github.com/users/Gargron/events{/privacy}","received_events_url":"https://api.github.com/users/Gargron/received_events","type":"User","site_admin":false},"created_at":"2017-06-02T01:36:35Z","updated_at":"2017-06-02T01:36:35Z","body":"At the time of writing, assets:precompile executes yarn install as well (needlessly so, but it's a gem issue), so with yarn cache clean things would be downloaded twice, I think. Of course, there is another point that maybe assets:precompile should be a step in the build process instead of something you execute yourself on a volume. Yet another point that you could split the docker image into two, one for the node.js based streaming API, and one for the ruby based main application (web + sidekiq), that would also reduce final image size (but you'd have two different images which would likely still amount to the same total size)"}}
{"actor":{"display_login":"Gargron"}}