Use APK cache if available on the host system

This commit is contained in:
Hunter Presnall 2020-07-14 16:54:06 -04:00 committed by Jakub Jirutka
parent 149b6a26ee
commit 63a0342a56

View file

@ -447,6 +447,11 @@ else
dump_alpine_keys etc/apk/keys/ dump_alpine_keys etc/apk/keys/
fi fi
# Use APK cache if available.
if [ -L /etc/apk/cache ]; then
ln -s "$(realpath /etc/apk/cache)" etc/apk/cache
fi
_apk add --root . --update-cache --initdb alpine-base _apk add --root . --update-cache --initdb alpine-base
prepare_chroot . prepare_chroot .
@ -493,6 +498,11 @@ if [ "$PACKAGES" ]; then
_apk add --root . $PACKAGES _apk add --root . $PACKAGES
fi fi
#-----------------------------------------------------------------------
if [ -L /etc/apk/cache ]; then
rm etc/apk/cache >/dev/null 2>&1
fi
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
if [ "$SCRIPT" ]; then if [ "$SCRIPT" ]; then
script_name="${SCRIPT##*/}" script_name="${SCRIPT##*/}"