This alpine-chroot-install
script simplifies installation of Alpine Linux in chroot.
Optionally it also utilizes qemu-user and binfmt to emulate different architecture.
The main purpose of this script is to easily create Alpine environment on debian-based CI (e.g. Travis CI) and possibly emulate other architectures (e.g. ARM) on x86_64 CI server.
Installation of Alpine Linux is a matter of seconds. When you run this script on Travis CI, it takes only 32 seconds to initialize VM, install Alpine into chroot including gcc build environment and execute first command! And just 9 seconds more if you run it with armhf emulation.
-
Linux system with common userland (Busybox or GNU coreutils)
-
POSIX-sh compatible shell (e.g. Busybox ash, dash, Bash, ZSH)
-
qemu-user ≥ 2.6 and binfmt, or apt-get (needed only for emulation of different architecture)
Note that QEMU older than 2.6 doesn’t support syscall getrandom
(384 on ARM) in qemu-user which may cause trouble with Alpine v3.5 and newer.
If older version of qemu-user is detected, the script fails.
Read documentation in alpine-chroot-install. See .travis.yml for Travis example.
You can copy alpine-chroot-install into your repository or download it on demand, e.g.:
wget https://raw.githubusercontent.com/alpinelinux/alpine-chroot-install/v0.12.1/alpine-chroot-install \
&& echo '5571ad4d17d14bb09ad23a75060f05553786e564 alpine-chroot-install' | sha1sum -c \
|| exit 1
This project is licensed under MIT License. For the full text of the license, see the LICENSE file.