-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
55 lines (43 loc) · 1.46 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
51
52
53
54
55
# Build Archlinux packages with drone
#
# docker build --rm=true -t mikkeloscar/arch-travis .
FROM archlinux/base:latest
MAINTAINER Mikkel Oscar Lyderik Larsen <m@moscar.net>
# Setup build user/group
ENV UGID='2000' UGNAME='travis'
RUN \
groupadd --gid "$UGID" "$UGNAME" && \
useradd --create-home --uid "$UGID" --gid "$UGID" --shell /usr/bin/false "${UGNAME}"
# copy sudoers file
COPY contrib/etc/sudoers.d/$UGNAME /etc/sudoers.d/$UGNAME
# Add pacman.conf template
COPY contrib/etc/pacman.conf /etc/pacman.conf
RUN cat /etc/pacman.d/mirrorlist
RUN \
# Update
pacman -Syu \
base-devel \
git \
reflector \
--noconfirm && \
# Clean .pacnew files
find / -name "*.pacnew" -exec rename .pacnew '' '{}' \;
RUN \
chmod 'u=r,g=r,o=' /etc/sudoers.d/$UGNAME && \
chmod 'u=rw,g=r,o=r' /etc/pacman.conf
USER $UGNAME
RUN \
sudo reflector --verbose -l 10 \
--sort rate --save /etc/pacman.d/mirrorlist && \
sudo pacman -Rs reflector --noconfirm
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/core_perl
# install cower and pacaur
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
# Add arch-travis script
COPY init.sh /usr/bin/arch-travis
ENTRYPOINT ["/usr/bin/arch-travis"]