36 lines
1.2 KiB
Docker
36 lines
1.2 KiB
Docker
# https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package
|
|
# This image build an intermediated environment to build + test Alpine packages
|
|
#
|
|
# Usage:
|
|
# $ podman run --rm -it -v ~/packages:/home/kawaii/packages localhost/aports
|
|
# => doas chown kawaii:users ~/packages
|
|
FROM alpine:edge
|
|
|
|
# Change repositories
|
|
RUN printf 'https://download.nus.edu.sg/mirror/alpine/edge/main\n\
|
|
https://download.nus.edu.sg/mirror/alpine/edge/community\n\
|
|
https://download.nus.edu.sg/mirror/alpine/edge/testing\n' > /etc/apk/repositories
|
|
|
|
RUN apk add --no-cache alpine-sdk doas vim \
|
|
&& mkdir -p /var/cache/distfiles \
|
|
&& chgrp abuild /var/cache/distfiles \
|
|
&& chmod g+x /var/cache/distfiles
|
|
|
|
# Create a normal user
|
|
RUN echo 'permit nopass :wheel' > /etc/doas.d/doas.conf \
|
|
&& chmod 600 /etc/doas.d/doas.conf \
|
|
&& printf 'cuteuser\ncuteuser\n' | adduser -h /home/kawaii -s /bin/ash -G wheel kawaii \
|
|
&& adduser kawaii abuild
|
|
|
|
# abuild only works as normal user
|
|
USER kawaii
|
|
WORKDIR /home/kawaii
|
|
|
|
# Tell abuild-keygen to use doas
|
|
ENV SUDO=doas
|
|
|
|
RUN git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports.git \
|
|
&& printf "\n" | abuild-keygen -a -i
|
|
|
|
CMD ["/bin/ash"]
|