-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.archlinux
50 lines (41 loc) · 1.37 KB
/
Dockerfile.archlinux
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
# This is Arch Linux, a rolling release... it doesn't make sense to use
# anything other than latest.
# checkov:skip=CKV_DOCKER_7:Arch Linux is a rolling release
# hadolint ignore=DL3007
FROM archlinux:latest
RUN pacman -Syu --noconfirm \
base-devel \
curl \
git \
sudo \
coreutils \
--needed
RUN useradd -m max && \
echo "max ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
USER max
# Skip using WORKDIR because we want to keep this overlay as lean as possible.
# hadolint ignore=DL3003
RUN git clone https://aur.archlinux.org/yay.git /tmp/yay && \
cd /tmp/yay && \
makepkg -si --noconfirm
USER root
RUN rm -rf /tmp/yay
USER max
ENV USER=max
# NOTE: This is dangerous because it will include decrypted secrets in the image!
#RUN mkdir -p /home/max/src/miscellaneous
#COPY --chown=max . /home/max/src/miscellaneous/
RUN mkdir -p /home/max/src && \
git clone https://github.com/Maxattax97/miscellaneous.git /home/max/src/miscellaneous
# Overwrite the install script with the latest one in the repository.
COPY --chown=max install.sh /home/max/src/miscellaneous/install.sh
WORKDIR /home/max/src/miscellaneous
RUN /bin/sh -o pipefail -c "yes | \
AUTOMATED=1 /home/max/src/miscellaneous/install.sh && \
pacman -Scc --noconfirm && \
yay -Scc --noconfirm && \
rm -rf /home/max/.cache/yay/* && \
rm -rf /var/cache/pacman/pkg/*"
WORKDIR /home/max
ENTRYPOINT ["/bin/zsh"]
HEALTHCHECK NONE