pikaur_builder/Dockerfile

29 lines
698 B
Docker
Raw Permalink Normal View History

2021-02-20 20:41:42 +01:00
FROM archlinux:latest
ARG uid=1000
2021-02-21 00:39:44 +01:00
ARG gid=33
2021-02-20 20:41:42 +01:00
2021-02-21 00:39:44 +01:00
RUN CHECK_GROUP=$(cat /etc/group|awk -F: '{print $3}'|egrep "^${gid}$"|wc -l) \
2021-02-22 19:22:43 +01:00
&& if [ $CHECK_GROUP -eq 0 ]; then groupadd -g ${gid} build; fi \
&& useradd -u ${uid} -g ${gid} -m -d /build build \
2021-02-20 20:41:42 +01:00
&& pacman -Sy --noconfirm \
base-devel \
glibc \
git \
sudo \
python-commonmark \
pyalpm \
&& chmod 600 /etc/sudoers \
2021-02-22 19:22:43 +01:00
&& sed -i"" '/root ALL.*/a build ALL=(ALL) NOPASSWD:ALL' /etc/sudoers \
2021-02-20 20:41:42 +01:00
&& chmod 440 /etc/sudoers
2021-02-22 19:22:43 +01:00
USER build
WORKDIR /build
2021-02-20 20:41:42 +01:00
RUN git clone https://aur.archlinux.org/pikaur.git \
&& cd pikaur \
&& makepkg -fsri --noconfirm
ENTRYPOINT ["/usr/bin/pikaur"]
CMD []