From 7a4f993eb829e82b4fdaaffa0280dc29e89350d5 Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Fri, 27 Dec 2024 23:31:41 +0100 Subject: [PATCH] build iso in containerized environment --- Dockerfile | 27 +++++++++++++++++++++++++++ Makefile | 3 ++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c7838a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM docker.io/archlinux:base-devel + +RUN pacman-key --init +RUN pacman -Sy archlinux-keyring --noconfirm + +RUN pacman -Syu git --noconfirm + +RUN echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers +RUN useradd --uid 1355 --create-home --shell /bin/bash --groups wheel build && \ + install -d /home/build/iso -o build + +VOLUME [ "/home/build/iso" ] + +USER build +WORKDIR /home/build + +RUN git clone https://git.noveria.org/LinuxSquare/PKGBUILDS.git && \ + cd PKGBUILDS && \ + git checkout PKGBUILD/alpineiso && \ + makepkg --noconfirm -si && \ + cd .. && \ + rm -rf PKGBUILDS && \ + sudo pacman --noconfirm -Scc + +RUN sudo chown -R build:wheel /home/build + +WORKDIR /home/build/iso diff --git a/Makefile b/Makefile index 54d8b65..c2ea355 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ iso: - sudo mkalpineiso -o out + sudo podman build -t novosbuild:arch . + sudo podman run -it -v $PWD:/home/build/iso novosbuild:arch sudo mkalpineiso -o /home/build/iso/out clean: sudo rm -f ${PWD}/out/*.iso