|
1 | 1 | # How to build the runtime |
2 | 2 |
|
| 3 | +We maintain and provide two official ways to build the runtime: |
| 4 | + |
| 5 | +- a Docker-based setup that caches dependencies and isolates the build environment from the system |
| 6 | +- a `chroot`-based method that can be used in isolated environments like, e.g., GitHub codespaces, if you cannot use Docker |
| 7 | + |
| 8 | +**Please note: We recommend regular users to use the Docker-based setup whenever possible!** The chroot based setup imposes a risk to break your local machine. It is meant **only** for environments that are otherwise isolated or reproducible, e.g., GitHub codespaces. |
| 9 | + |
| 10 | + |
| 11 | +## chroot-based environment |
| 12 | + |
| 13 | +The chroot-based environment is designed for people who really do not want to use containers and/or run on systems that do not support such an environment (e.g., GitHub codespaces, FreeBSD). |
| 14 | + |
| 15 | +To run a build, use the following command: |
| 16 | + |
| 17 | +```sh |
| 18 | +> env ALPINE_ARCH=<arch> chroot/chroot_build.sh |
| 19 | + |
| 20 | +# example calls: |
| 21 | +> env ALPINE_ARCH=x86_64 chroot/chroot_build.sh |
| 22 | +> env ALPINE_ARCH=i686 chroot/chroot_build.sh |
| 23 | +> env ALPINE_ARCH=armhf chroot/chroot_build.sh |
| 24 | +> env ALPINE_ARCH=aarch64 chroot/chroot_build.sh |
| 25 | +``` |
| 26 | + |
| 27 | +The script will download an Alpine miniroot image, extract it into a specific location, bind-mount a set of temporary filesystems (e.g., `/proc`) there, chroot into there and run the build script. It attempts to unmount the previously mounted paths again. |
| 28 | + |
| 29 | + |
3 | 30 | ## Docker |
4 | 31 |
|
5 | 32 | As the runtime build requires a special environment with specific dependencies prebuilt and installed as static binaries, we provide a containerized build environment. We use Docker as a runtime for now. |
@@ -65,12 +92,3 @@ To specify commands that should be run, use the established `--` to distinguish |
65 | 92 | > env ARCH=<arch> scripts/create-build-container.sh -u $(id -u):(id -g) -- bash some-script.sh |
66 | 93 | ``` |
67 | 94 |
|
68 | | -## chroot-based environment |
69 | | - |
70 | | -The chroot-based environment is designed for people who really do not want to use containers and/or run on systems that do not support such an environment (e.g., FreeBSD). |
71 | | - |
72 | | -To run a build, use the following command: |
73 | | - |
74 | | -```sh |
75 | | -> env ARCHITECTURE=<arch> chroot/chroot_build.sh |
76 | | -``` |
|
0 commit comments