Skip to content

Commit 0f4256e

Browse files
committed
Setup apk cache on persistent volume
Added packages must be reinstalled on each boot because Alpine runs from an ISO. Setting up the package cache avoid having to re-download the packages each time. Signed-off-by: Jan Dubois <[email protected]>
1 parent 9a5ca0d commit 0f4256e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/04-persistent-data-volume.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ if [ "$(awk '$2 == "/" {print $3}' /proc/mounts)" == "tmpfs" ]; then
5050
for MP in $(mount | awk '$3 ~ /^\/tmp\// {print $3}'); do
5151
umount "${MP}"
5252
done
53+
# setup apk package cache
54+
mkdir -p /mnt/data/apk/cache
55+
mkdir -p /etc/apk
56+
ln -s /mnt/data/apk/cache /etc/apk/cache
57+
# Move all persisted directories to the data volume
5358
for DIR in ${DATADIRS}; do
5459
DEST="/mnt/data$(dirname "${DIR}")"
5560
mkdir -p "${DIR}" "${DEST}"

0 commit comments

Comments
 (0)