/alpine-chroot-install

Install Alpine Linux in chroot with a breeze. Build ARM on Travis CI or any other x86_64 CI.

Primary LanguageShellMIT LicenseMIT

Install Alpine Linux in chroot

Build Status

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 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.

To get some comparison, look here how long does this take with minimal Debian. 360 seconds! This is 9 times more. Do you see how bloated and slow Debian is…? ;)

Requirements

  • Linux system with common userland (Busybox or GNU coreutils)

  • POSIX-sh compatible shell (e.g. Busybox ash, dash, Bash)

  • qemu-user and binfmt, or apt-get (needed only for emulation)

Warning
QEMU <2.6 doesn’t support syscall getrandom (384 on ARM) in qemu-user which may cause trouble with Alpine v3.5 and newer. If you’re on a Debian-based distro, just install qemu-user-static from Ubuntu Yakkety or newer.

Usage

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/jirutka/alpine-chroot-install/v0.1.1/alpine-chroot-install

License

This project is licensed under MIT License. For the full text of the license, see the LICENSE file.