![]() Prepare user environment at build time and update user and group id at runtime if necessary. Update submodule sync step to avoid a dependency on cargo Run `make update all` instead of just `make all`. The target `update` didn't update the container environment since it was executed on the host. |
||
---|---|---|
.. | ||
Dockerfile | ||
entrypoint.sh | ||
README.md |
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.
git clone https://github.com/redox-os/redox.git ; cd redox #1
git pull --rebase --recurse-submodules && git submodule sync \
&& git submodule update --recursive --init #2
docker build --build-arg LOCAL_UID="$(id -u)" --build-arg LOCAL_GID="$(id -g)" \
-t redox docker/ #3
docker run --cap-add MKNOD --cap-add SYS_ADMIN \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
--device /dev/fuse -v "$(pwd):/home/user/src" --rm redox make update all #4
make qemu #5
To unpack:
- Creates a local copy of the repository.
- Updates all the submodules in the repository.
- 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. - Builds Redox using the
redox
image. The arguments allow the container to usefuse
and ensure the resulting files are owned by the current user. - Runs Redox.
On selinux systems, replace #4 with:
docker run --cap-add MKNOD --cap-add SYS_ADMIN \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
--device /dev/fuse -v "$(pwd):/home/user/src" --security-opt label=disable \
--rm redox make update all