Project

General

Profile

Bug #9063

`apk del` now downloads packages cache

Added by Vlad Frolov 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Base libraries
Target version:
Start date:
07/07/2018
Due date:
% Done:

100%

Estimated time:
Affected versions:
Security IDs:

Description

The behavior of apk del has changed so it now automatically downloads packages cache and so the pattern used in many Dockerfiles (apk add --no-cache gcc && ... && apk del gcc) now causes unnecessary packages cache to be included in the final image: https://github.com/frol/docker-alpine-glibc/issues/22

Should I update all my Dockerfiles to use apk del --no-cache instead of apk del?

Associated revisions

Revision e1a05c74 (diff)
Added by Timo Teräs 6 months ago

prevent automatic repository index update for 'apk del'

ref #9063

Revision 4df74a61 (diff)
Added by Natanael Copa 5 months ago

main/apk-tools: don't update index on delete

backport from upstream

fixes #9063

(cherry picked from commit 09b110fc99a36f12c0b49e6029a231a231ce920d)

Revision b71a30c1 (diff)
Added by Natanael Copa 5 months ago

main/apk-tools: don't update index on delete

backport from upstream

fixes #9063

(cherry picked from commit 09b110fc99a36f12c0b49e6029a231a231ce920d)

History

#1 Updated by Vlad Frolov 7 months ago

It also affects Alpine 3.7 as apk 2.9.1 is shipped to it as well.

Consider the following script:

apk add --no-cache bash
apk del bash

apk 2.8.2 works fine and there is nothing left in the /var/cache/apk/ folder:

/ # ls -la /var/cache/apk/
total 1092
drwxr-xr-x    1 root     root          4096 Jul  8 08:23 .
drwxr-xr-x    1 root     root          4096 Apr 10 18:27 ..

apk 2.9.1 works fine as well, but there are APKINDEX files left in the /var/cache/apk/ folder now:

/ # ls -la /var/cache/apk/
total 1208
drwxr-xr-x    1 root     root          4096 Jul  8 08:46 .
drwxr-xr-x    1 root     root          4096 Jul  5 14:46 ..
-rw-r--r--    1 root     root        451471 Jul  8 08:46 APKINDEX.5022a8a2.tar.gz
-rw-r--r--    1 root     root        768769 Jul  8 08:46 APKINDEX.70c88391.tar.gz

Thus, some Docker images may become 1.2MB bigger now.

#2 Updated by Natanael Copa 5 months ago

  • Target version set to 3.7.1

#3 Updated by Natanael Copa 5 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#4 Updated by Natanael Copa 5 months ago

  • Target version changed from 3.7.1 to 3.8.1

#5 Updated by Natanael Copa 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF