Skip to content
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

exec apk del create cache file,can we use apk del --no-cache,Reduced image size 1M #708

Closed
khs1994 opened this issue Aug 23, 2018 · 1 comment
Labels
Request Request for image modification or feature

Comments

@khs1994
Copy link

khs1994 commented Aug 23, 2018

I found image have apk cache file

$ docker run -it --rm php:7.2.9-fpm-alpine ls -la /var/cache/apk

total 1260
drwxr-xr-x    1 root     root          4096 Aug 23 00:18 .
drwxr-xr-x    1 root     root          4096 Jul  5 14:47 ..
-rw-r--r--    1 root     root        750769 Aug 23 00:18 APKINDEX.adfa7ceb.tar.gz
-rw-r--r--    1 root     root        525412 Aug 23 00:18 APKINDEX.efaa1f73.tar.gz

Then I found this cache file create by $ apk del

$ docker run -it --rm alpine:3.8 sh

$ apk add --no-cache php

$ ls -la /var/cache/apk

# empty

$ apk del php

$ ls -la /var/cache/apk

drwxr-xr-x    1 root     root          4096 Aug 23 09:07 .
drwxr-xr-x    1 root     root          4096 Jul  5 14:47 ..
-rw-r--r--    1 root     root        750769 Aug 23 09:07 APKINDEX.adfa7ceb.tar.gz
-rw-r--r--    1 root     root        525412 Aug 23 09:07 APKINDEX.efaa1f73.tar.gz

exec apk del create cache file on /var/cache/apk

exec apk del --no-cache don't create cache file.

@wglambert wglambert added the Request Request for image modification or feature label Aug 23, 2018
@yosifkit
Copy link
Member

Related comment: docker-library/python#330 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

3 participants