-
Notifications
You must be signed in to change notification settings - Fork 333
Remove apk cache #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove apk cache #229
Conversation
mtsmfm
commented
Sep 6, 2018
``` $ docker image ls ruby:alpine REPOSITORY TAG IMAGE ID CREATED SIZE ruby alpine e8e61f5c55cb 35 hours ago 62MB $ docker run --rm -it ruby:alpine ls -la /var/cache/apk total 1204 drwxr-xr-x 1 root root 4096 Sep 5 05:55 . drwxr-xr-x 1 root root 4096 Jul 5 14:46 .. -rw-r--r-- 1 root root 451901 Sep 5 05:55 APKINDEX.5022a8a2.tar.gz -rw-r--r-- 1 root root 769090 Sep 5 05:55 APKINDEX.70c88391.tar.gz ``` ``` $ docker image ls my-ruby REPOSITORY TAG IMAGE ID CREATED SIZE my-ruby latest ca40c914bcb6 About a minute ago 60.8MB $ docker run --rm -it my-ruby ls -la /var/cache/apk total 8 drwxr-xr-x 2 root root 4096 Jul 5 14:46 . drwxr-xr-x 1 root root 4096 Jul 5 14:46 .. ```
bzip2 \ | ||
ca-certificates \ | ||
libffi-dev \ | ||
libressl-dev \ | ||
procps \ | ||
yaml-dev \ | ||
zlib-dev \ | ||
&& apk del .ruby-builddeps \ | ||
&& apk del --no-cache .ruby-builddeps \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From docker-library/python#330 (comment):
This is actually a (recent) bug, and they're planning to fix it: https://bugs.alpinelinux.org/issues/9063
(https://git.alpinelinux.org/cgit/apk-tools/commit/?id=e1a05c74cb8ae6ab41ee960343cc64a0a9af95a5)
https://git.alpinelinux.org/cgit/apk-tools/commit/?id=8a28c6d0d4f81406c67e76b2bcdbe491aa734717 appears to be the commit which introduced this "autoupdate" behavior.
On the other hand, it does affect alpine 3.7 based images (and current 3.8) since the Alpine bug is only being updated in 3.8. 😢
Now every apk add|del
will need to download the cache and delete it, even if it could've been done without hitting the network (and --no-network
doesn't help).
So, I guess LGTM cc @tianon.
cc @ncopa, is there any other way to get apk to not download the cache on every This bug, https://bugs.alpinelinux.org/issues/9063, shows that only 3.8 is getting the fix for I'm not sure if you have seen an increase in bandwidth on your cdn, but this issue could have a large impact as we fix base images to not have cache files and every user starts downloading them in each Related issues: docker-library/python#330, docker-library/php#708 |
I guess it makes sense to fix it in v3.7 as well. |
prevent update repository index when --no-network is specified. fixes #9126 Backported on request: docker-library/ruby#229 (comment)
So if I'm reading right, we should be using |