-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathDockerfile
50 lines (38 loc) · 1.3 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM archlinux/archlinux:base-devel
MAINTAINER Vufa <[email protected]>
ENV UGID='2000' UGNAME='build'
# Add sudoers
RUN echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$UGNAME
RUN chmod 'u=r,g=r,o=' /etc/sudoers.d/$UGNAME
RUN \
# Update
pacman-key --init && \
pacman-key --populate archlinux && \
pacman -Syu \
base-devel \
git \
reflector \
rsync \
--noconfirm --need && \
# Clean .pacnew files
find / -name "*.pacnew" -exec rename .pacnew '' '{}' \;
# Setup build user/group
RUN \
groupadd --gid "$UGID" "$UGNAME" && \
useradd --create-home --uid "$UGID" --gid "$UGID" --shell /usr/bin/false "${UGNAME}"
USER $UGNAME
RUN \
sudo reflector --verbose -l 10 \
--sort rate --save /etc/pacman.d/mirrorlist
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/core_perl
# install yay
RUN \
cd /home/$UGNAME && \
curl -O -s https://aur.archlinux.org/cgit/aur.git/snapshot/yay-bin.tar.gz && \
tar xf yay-bin.tar.gz && \
cd yay-bin && makepkg -is --skippgpcheck --noconfirm && cd .. && \
rm -rf yay-bin && rm yay-bin.tar.gz
# Enable multilib repo
RUN sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]