Skip to content

Instantly share code, notes, and snippets.

@AnotherDroog
Created May 24, 2019 16:38
Show Gist options
  • Save AnotherDroog/a0b82f64ba973c2fc5a7095f4b2ac831 to your computer and use it in GitHub Desktop.
Save AnotherDroog/a0b82f64ba973c2fc5a7095f4b2ac831 to your computer and use it in GitHub Desktop.
Create cache file within alpine chroot
#!/bin/sh
WORLD=/etc/apk/world
ALPINE_RELEASE=3.9.4
echo "Running make_cache"
echo "alpine-base" > ${WORLD}
echo "avahi" >> ${WORLD}
echo "dbus" >> ${WORLD}
echo "docker" >> ${WORLD}
echo "openssh" >> ${WORLD}
echo "wireless-tools" >> ${WORLD}
echo "wpa_supplicant" >> ${WORLD}
DIR=$(pwd)
mkdir /tmp/cache
ln -s /tmp/cache /etc/apk/cache
apk update && apk cache -v sync
cd /tmp
tar cvzf cache-${ALPINE_RELEASE}.tar.gz cache
cp cache-${ALPINE_RELEASE}.tar.gz ${DIR}/
echo "Done"
exit
apt-get update
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.10.0/alpine-chroot-install \
&& echo 'dcceb34aa63767579f533a7f2e733c4d662b0d1b alpine-chroot-install' | sha1sum -c \
|| exit 1
chmod +x alpine-chroot-install
apt-get install qemu-user-binfmt -y
./alpine-chroot-install -b v3.9 -a armhf -m https://mirror.xtom.com.hk/alpine/
chmod +x chroot_cache.sh
/alpine/enter-chroot ./chroot_cache.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment