2017-06-24 11:45:21 +02:00
### Building Redox using Docker images with the toolchain
*All you need is git, make, qemu, fuse and docker. The method requires a non-privileged user able to run the `docker` command, which is usually achieved by adding the user to the `docker` group.*
```shell
git clone https://github.com/redox-os/redox.git ; cd redox #1
2017-07-24 17:15:45 +02:00
docker build --build-arg LOCAL_UID="$(id -u)" --build-arg LOCAL_GID="$(id -g)" \
2017-08-12 01:53:51 +02:00
-t redox docker/ #2
git pull --rebase --recurse-submodules & & git submodule sync \
&& git submodule update --recursive --init #3
2017-06-26 04:21:19 +02:00
docker run --cap-add MKNOD --cap-add SYS_ADMIN \
2017-07-24 17:15:45 +02:00
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
2017-08-12 01:53:51 +02:00
--device /dev/fuse -v "$(pwd):/home/user/src" --rm redox make fetch all #4
2017-06-24 11:45:21 +02:00
make qemu #5
```
To unpack:
1. Creates a local copy of the repository.
2017-08-12 01:53:51 +02:00
2. Creates a new image in the local image repository named `redox` with Redox toolchain installed. You only need to rebuild the image if you want to update the toolchain.
3. Updates all the submodules in the repository.
2017-06-24 11:45:21 +02:00
4. Builds Redox using the `redox` image. The arguments allow the container to use `fuse` and ensure the resulting files are owned by the current user.
5. Runs Redox.
2017-07-24 00:29:33 +02:00
2017-08-23 22:09:24 +02:00
For SELinux, seccomp, and AppArmor enabled systems, please add following commands to #4 accordingly:
```
--security-opt label=disable // disable SELinux
--security-opt seccomp=unconfined // disable seccomp
--security-opt apparmor=unconfined // disable AppArmor
```
E.g., on SELinux systems, replace #4 with:
2017-07-24 00:29:33 +02:00
```
docker run --cap-add MKNOD --cap-add SYS_ADMIN \
2017-07-24 17:15:45 +02:00
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
2017-08-23 22:09:24 +02:00
--device /dev/fuse -v "$(pwd):/home/user/src" --security-opt label=disable \
2017-08-12 01:53:51 +02:00
--rm redox make fetch all
2017-07-24 00:29:33 +02:00
```