From 73f4928b05f12eb36d43c2bc8859f38117c817cc Mon Sep 17 00:00:00 2001 From: Max O'Cull Date: Tue, 27 Aug 2024 12:18:12 -0400 Subject: [PATCH] Fix docker permissions for removing yay cache, hadolint fixes --- Dockerfile | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b67b8c9..7eb15c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# This is Arch Linux, a rolling release... it doesn't make sense to use +# anything other than latest. +# hadolint ignore=DL3007 FROM archlinux:latest RUN pacman -Syu --noconfirm \ @@ -12,23 +15,28 @@ 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 && \ - rm -rf /tmp/yay + makepkg -si --noconfirm + +USER root +RUN rm -rf /tmp/yay +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 -RUN git clone https://github.com/Maxattax97/miscellaneous.git /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 yes | AUTOMATED=1 /home/max/src/miscellaneous/install.sh +RUN /bin/sh -o pipefail -c "yes | AUTOMATED=1 /home/max/src/miscellaneous/install.sh" WORKDIR /home/max ENTRYPOINT ["/bin/zsh"]