Skip to content

Commit 120b130

Browse files
authored
Merge pull request #1471 from rancher-sandbox/apk-cache
Setup apk cache on persistent volume
2 parents 9a5ca0d + 0f4256e commit 120b130

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)