alpine-chroot-install(8)
π alpine-chroot-install β like, the NAME section but make it cute π
okay bestie, gather round π«Ά this is alpine-chroot-install, a lil script from the System Manager's Manual (section 8, system admin tools, very demure, very mindful) and what it does is bootstrap an Alpine Linux chroot. that's it, that's the whole vibe. β¨
πΈ SYNOPSIS πΈ
alpine-chroot-install -d /directory [options]
like yes, you gotta give it a directory, and then optionally a whole lil bouquet of options. π
π¦ DESCRIPTION π¦
So this script installs Alpine Linux into a chroot, and then β if you want β it sets up qemu-user and binfmt so you can emulate a different architecture (think armhf, the little ARM girlies π§). no cap, it really does that.
β¨ OPTIONS AND ENVIRONMENT VARIABLES β¨
every single one, we're not skipping a single one, periodt:
-a ARCHβ the CPU architecture for the chroot. don't set it? then it just matches your host's architecture, easy. but if it's different from the host's, bestie it gets emulated withqemu-user. the options are:x86_64,x86,aarch64,armhf,armv7,ppc64le,riscv64,s390x. π-b ALPINE_BRANCHβ which Alpine branch to install. default islatest-stable. π-d CHROOT_DIRβ absolute path to the directory where the Alpine chroot should be installed. ngl, Debian's version of this script requires you to give this explicitly β like-d /alpine. no skipping it there. π-i BIND_DIRβ absolute path to the directory on the host system that should be mounted on the same path inside the chroot. default isPWD, but only if it's under/homeβ otherwise, none. π-k CHROOT_KEEP_VARSβ the names of the environment variables to pass from the host environment into the chroot, courtesy of theenter-chrootscript. a name can be an extended regular expression, fancy! default:ARCH CI QEMU_EMULATOR TRAVIS_.*. π-m ALPINE_MIRRORβ URI of the Aports mirror to fetch packages from. default ishttp://dl-cdn.alpinelinux.org/alpine. π-p ALPINE_PACKAGESβ Alpine packages to install into the chroot. default isbuild-base ca-certificates ssl_client. β-r EXTRA_REPOSβ Alpine repositories to be added to/etc/apk/repositories(mainandcommunityfrom$ALPINE_MIRRORare always added, no exceptions). π₯-t TEMP_DIRβ absolute path to the directory where temporary files get stored. defaults tomktemp -d. π-hβ show this help message and exit. the classic. π-vβ print version and exit. πAPK_TOOLS_URIβ URL ofapk.staticto download. default is thex86_64binary fromhttps://gitlab.alpinelinux.org/alpine/apk-tools/-/packages. π¦APK_TOOLS_SHA256β the SHA-256 checksum of$APK_TOOLS_URI. for the safety girlies. π
and here's the tea, bestie: each option can also be provided by an environment variable. but if both the option and the variable are specified, and the option only accepts one argument, then the option takes precedence. iykyk. π
π AFTER INSTALL π
this tool is generous, it also creates a script called enter-chroot inside the chroot directory, so you can actually enter the chroot environment. that script does the following, in order:
- saves environment variables specified by
$CHROOT_KEEP_VARSandPWD, - chroots into
$CHROOT_DIR, - starts clean environment using
env -i, - switches user and simulates full login using
su -l, - loads saved environment variables and changes directory to saved
PWD, - executes specified command or
shif not provided.
main character energy, honestly. π
Example, because examples ate:
sudo alpine-chroot-install -d /alpine -p build-base -p cmake
/alpine/enter-chroot -u $USER ./build
β οΈ heads up bestie: -d CHROOT_DIR is the one thing you really can't fumble β it's an absolute path, and on Debian's version of this script it is required. don't come crying to me. π
and that's the whole page, fr fr π this was alpine-chroot-install(8), straight from the Alpine Linux girlies, dated 2022-07-22 β that's the source and the date and the version all wrapped up in one cute lil sign-off. slay, bye!! πβ¨
π¦ where this page comes from
- debian bookworm: alpine-chroot-install 0.14.0-1 Β· MIT
- debian trixie: alpine-chroot-install 0.14.0-1 Β· MIT
- ubuntu noble: alpine-chroot-install 0.14.0-1 Β· MIT
- ubuntu resolute: alpine-chroot-install 0.14.0-1build1 Β· MIT
- ubuntu stonking: alpine-chroot-install 0.14.0-1build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms