diff options
author | Freya Murphy <freya@freyacat.org> | 2025-08-10 11:56:56 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-08-14 20:48:39 -0400 |
commit | 6fad1a21cb4f0f05023a28cbfa8ad38b82db6a1b (patch) | |
tree | 4f6f27c38d1349a584423958dcdc5296b5d6b290 /Dockerfile | |
parent | iksemel (diff) | |
download | aports-6fad1a21cb4f0f05023a28cbfa8ad38b82db6a1b.tar.gz aports-6fad1a21cb4f0f05023a28cbfa8ad38b82db6a1b.tar.bz2 aports-6fad1a21cb4f0f05023a28cbfa8ad38b82db6a1b.zip |
aports: refactor and freya-base
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 50 |
1 files changed, 46 insertions, 4 deletions
@@ -1,6 +1,48 @@ -FROM alpine +ARG UID="1000" +ARG GID="1000" +ARG ALPINE_VERSION="3.22" +FROM alpine:${ALPINE_VERSION} + +# set environment +ARG ALPINE_VERSION +ARG UID +ARG GID + +# add repos +RUN cat <<EOF > /etc/apk/repositories +http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main +http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community +EOF + +# install packages RUN apk -U add alpine-sdk doas RUN echo "permit nopass :wheel" >> /etc/doas.d/doas.conf -RUN adduser -D user && adduser user abuild && adduser user wheel -USER user -CMD ["/bin/sh", "-c", "for port in /aports/*; do cd \"$port\" && abuild -r; done"] + +# create build user +RUN <<EOF +getent group ${GID} || addgroup -g ${GID} builder +adduser -u ${UID} -G $(getent group ${GID} | cut -d: -f1) -D builder +adduser builder abuild +adduser builder wheel +EOF + +# create scripts +RUN <<EOF +cat <<CAT > /bin/aports-build +#!/bin/sh +for port in \$APORTS; do + cd "/aports/\$port" + abuild -r +done +CAT +chmod +x /bin/aports-build + +cat <<CAT > /bin/aports-keygen +#!/bin/sh +echo \$PACKAGER_PRIVKEY | abuild-keygen +CAT +chmod +x /bin/aports-keygen +EOF + +# set user +USER builder |