Addidng Dockerfile for artix devel env and script/example of usage.

This commit is contained in:
2026-07-26 18:10:50 +02:00
parent 409cc70822
commit f6b016bbec
2 changed files with 33 additions and 0 deletions
+26
View File
@@ -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"]
+7
View File
@@ -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/"