Files
pkgmgr/Dockerfile
Kevin Veen-Birkenbach 9679478353 Improve Docker-based build & test pipeline for pkgmgr
- Add .dockerignore rules to prevent Arch package artifacts from entering the build context
- Rework Dockerfile to remove stale package artifacts before makepkg and use a dev entry script
- Introduce docker-entry-dev.sh to always rebuild pkgmgr from the mounted /src tree
- Update Makefile 'test' target to rebuild pkgmgr inside the container before running tests
- Fix predictable makepkg failures caused by residual *.pkg.tar.* files

Conversation reference: https://chatgpt.com/share/6935e6e8-f3fc-800f-a4e9-7537114f13d1
2025-12-07 21:43:38 +01:00

34 lines
964 B
Docker

FROM archlinux:latest
# 1) System basis + Nix
RUN pacman -Syu --noconfirm \
&& pacman -S --noconfirm --needed \
base-devel \
git \
nix \
rsync \
&& pacman -Scc --noconfirm
ENV NIX_CONFIG="experimental-features = nix-command flakes"
# 2) Unprivileged user for building Arch packages
RUN useradd -m builder
# 3) Build-Stage (optional): einmal aus /build bauen, wenn du magst
WORKDIR /build
COPY . .
RUN chown -R builder:builder /build \
&& su builder -c "cd /build && rm -f package-manager-*.pkg.tar.* && makepkg -sf --noconfirm --clean" \
&& pacman -U --noconfirm package-manager-*.pkg.tar.* \
&& rm -rf /build
# 4) Runtime-Workingdir für das gemountete Repo
WORKDIR /src
# 5) Entry-Script für „always build from /src“
COPY scripts/docker-entry-dev.sh /usr/local/bin/docker-entry-dev.sh
RUN chmod +x /usr/local/bin/docker-entry-dev.sh
ENTRYPOINT ["/usr/local/bin/docker-entry-dev.sh"]
CMD ["--help"]