{"action":"created","issue":{"url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/40","labels_url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/40/comments","events_url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/40/events","html_url":"https://github.com/docker-library/buildpack-deps/issues/40","id":129556614,"number":40,"title":"Automated builds intermittently failing on `apt-get install` due to apt cache issues","user":{"login":"callbacknull","id":969761,"avatar_url":"https://avatars.githubusercontent.com/u/969761?v=3","gravatar_id":"","url":"https://api.github.com/users/callbacknull","html_url":"https://github.com/callbacknull","followers_url":"https://api.github.com/users/callbacknull/followers","following_url":"https://api.github.com/users/callbacknull/following{/other_user}","gists_url":"https://api.github.com/users/callbacknull/gists{/gist_id}","starred_url":"https://api.github.com/users/callbacknull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callbacknull/subscriptions","organizations_url":"https://api.github.com/users/callbacknull/orgs","repos_url":"https://api.github.com/users/callbacknull/repos","events_url":"https://api.github.com/users/callbacknull/events{/privacy}","received_events_url":"https://api.github.com/users/callbacknull/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-01-28T19:39:41Z","updated_at":"2016-01-29T00:52:13Z","closed_at":null,"body":"So approximately one in every eight of my automated builds on docker hub will fail on trying to install packages with `apt-get install`. The error I get `Error reading from server. Remote end closed connection [IP: 128.31.0.66 80]` makes it seem like either docker hub is dropping the connections to debian's apt servers or the apt cache of the container is in a weird state.\r\n\r\nBuild logs: http://pastebin.com/FXxe6XH5\r\nSource image: `FROM node:4.2.4-slim`\r\nRun line: `RUN apt-get update && apt-get install -y   python  python-dev  python-pip  python-virtualenv   && apt-get clean    && rm -rf /var/lib/apt/lists/*`\r\n\r\nYesterday I added a pre-install clean making that run line: `RUN apt-get clean && apt-get update && apt-get install -y   python  python-dev  python-pip  python-virtualenv   && apt-get clean    && rm -rf /var/lib/apt/lists/*`\r\nI am at 20 builds without issue so far after adding that to my Dockerfile.\r\n\r\nI checked the node dockerfile, they don't install anything through `apt-get` so that leaves the build packs. Is there any reason to not add `apt-get clean` to the end of each apt-get install? PR is coming"},"comment":{"url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/comments/176501356","html_url":"https://github.com/docker-library/buildpack-deps/issues/40#issuecomment-176501356","issue_url":"https://api.github.com/repos/docker-library/buildpack-deps/issues/40","id":176501356,"user":{"login":"md5","id":76367,"avatar_url":"https://avatars.githubusercontent.com/u/76367?v=3","gravatar_id":"","url":"https://api.github.com/users/md5","html_url":"https://github.com/md5","followers_url":"https://api.github.com/users/md5/followers","following_url":"https://api.github.com/users/md5/following{/other_user}","gists_url":"https://api.github.com/users/md5/gists{/gist_id}","starred_url":"https://api.github.com/users/md5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/md5/subscriptions","organizations_url":"https://api.github.com/users/md5/orgs","repos_url":"https://api.github.com/users/md5/repos","events_url":"https://api.github.com/users/md5/events{/privacy}","received_events_url":"https://api.github.com/users/md5/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T00:52:13Z","updated_at":"2016-01-29T00:52:13Z","body":"@callbacknull That seems like it would break existing images. There many images out there that do `RUN apt-get update` and `RUN apt-get install -y some-package` in separate lines (or separate `Dockerfile`s)."}}