diff --git a/tools/artix-dinit-dev-env/Dockerfile b/tools/artix-dinit-dev-env/Dockerfile new file mode 100644 index 0000000..dc348c9 --- /dev/null +++ b/tools/artix-dinit-dev-env/Dockerfile @@ -0,0 +1,26 @@ +FROM artixlinux/artixlinux:base-dinit + +# Install necessary build tools +RUN pacman -Suy --noconfirm base-devel git wget sudo make pacman-contrib + +# Config to use 16 thread for building +RUN printf 'MAKEFLAGS="-j16"\n' > /etc/makepkg.conf.d/j16.conf + +# Create a build user +RUN useradd -m builduser \ + && passwd -d builduser \ + && printf 'builduser ALL=(ALL) ALL\n' >> /etc/sudoers + +# Set working directory +WORKDIR /home/builduser + +# Build the package as the non-root user +# -s: install missing dependencies +# -c: clean build directory after successful build +# --noconfirm: auto-confirm prompts +USER builduser + +# Do NOT copy source code or run makepkg here. +# Leave the container ready to accept any mounted directory. +CMD ["bash"] + diff --git a/tools/artix-dinit-dev-env/build.sh b/tools/artix-dinit-dev-env/build.sh new file mode 100755 index 0000000..07be6e7 --- /dev/null +++ b/tools/artix-dinit-dev-env/build.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo "Package src dir: $1" +echo "Package bin dir: $2" +docker run --interactive --tty --rm --volume $1:/pkgsrc:z --volume $2:/artifact:z artix-build-env bash -c "cp /pkgsrc/* ./ && makepkg -Ccsf --noconfirm && cp *.pkg.tar.zst /artifact/" + +