SHA256
Addidng Dockerfile for artix devel env and script/example of usage.
This commit is contained in:
@@ -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"]
|
||||||
|
|
||||||
Executable
+7
@@ -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/"
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user