Skip to content
Install Alpine Linux in chroot with a breeze. Build ARM on Travis CI or any other x86_64 CI.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.travis.yml
LICENSE
Makefile Makefile: Declare "install" as PHONY and sort targets Nov 15, 2017
README.adoc Release version 0.10.0 Nov 24, 2018
alpine-chroot-install

README.adoc

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

Requirements

  • 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 tries to install newer version of qemu-user-static using apt-get. If there’s no newer version in the default system’s repository, it installs qemu-user-static from the Ubuntu Artful’s repository.

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/alpinelinux/alpine-chroot-install/v0.10.0/alpine-chroot-install \
    && echo 'dcceb34aa63767579f533a7f2e733c4d662b0d1b  alpine-chroot-install' | sha1sum -c \
    || exit 1

License

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

You can’t perform that action at this time.