From 633a0fb80c8df8b2e9d5b739df0c0308aeebf161 Mon Sep 17 00:00:00 2001 From: casjay Date: Sat, 10 Aug 2024 21:26:21 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile Dockerfile.8 Dockerfile.9 --- Dockerfile | 10 ++++++---- Dockerfile.8 | 10 ++++++---- Dockerfile.9 | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 88c99c4..eb3ce0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,19 +66,21 @@ ENV HOSTNAME="casjaysdevdocker-almalinux" USER ${USER} WORKDIR /root +COPY ./rootfs/usr/local/bin/. /usr/local/bin/ + RUN set -e; \ echo "Setting up prerequisites"; \ yum makecache && yum install -yy bash; \ SH_CMD="$(which sh 2>/dev/null)"; \ BASH_CMD="$(which bash 2>/dev/null)"; \ - [ -x "$BASH_CMD" ] && { rm -Rf "$SH_CMD"|| true ;ln -s "$BASH_CMD" "$SH_CMD"; } || true; \ - [ -x "$BASH_CMD" ] && { rm -rf "/bin/sh" || true; } && ln -sf "$BASH_CMD" "/bin/sh" || true; \ - [ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'$BASH_CMD'|g' "/etc/passwd" || true + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/usr/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && [ "\$SH_CMD" != "/bin/sh"] && symlink "\$BASH_CMD" "\$SH_CMD" || true; \ + [ -n "\$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'\$BASH_CMD'|g' "/etc/passwd" || true ENV SHELL="/bin/bash" SHELL [ "/bin/bash", "-c" ] -COPY ./rootfs/usr/local/bin/. /usr/local/bin/ COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu RUN echo "Initializing the system"; \ diff --git a/Dockerfile.8 b/Dockerfile.8 index af8b955..ede74f9 100644 --- a/Dockerfile.8 +++ b/Dockerfile.8 @@ -66,19 +66,21 @@ ENV HOSTNAME="casjaysdevdocker-almalinux" USER ${USER} WORKDIR /root +COPY ./rootfs/usr/local/bin/. /usr/local/bin/ + RUN set -e; \ echo "Setting up prerequisites"; \ yum makecache && yum install -yy bash; \ SH_CMD="$(which sh 2>/dev/null)"; \ BASH_CMD="$(which bash 2>/dev/null)"; \ - [ -x "$BASH_CMD" ] && { rm -Rf "$SH_CMD"|| true ;ln -s "$BASH_CMD" "$SH_CMD"; } || true; \ - [ -x "$BASH_CMD" ] && { rm -rf "/bin/sh" || true; } && ln -sf "$BASH_CMD" "/bin/sh" || true; \ - [ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'$BASH_CMD'|g' "/etc/passwd" || true + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/usr/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && [ "\$SH_CMD" != "/bin/sh"] && symlink "\$BASH_CMD" "\$SH_CMD" || true; \ + [ -n "\$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'\$BASH_CMD'|g' "/etc/passwd" || true ENV SHELL="/bin/bash" SHELL [ "/bin/bash", "-c" ] -COPY ./rootfs/usr/local/bin/. /usr/local/bin/ COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu RUN echo "Initializing the system"; \ diff --git a/Dockerfile.9 b/Dockerfile.9 index 8258f40..2af018b 100644 --- a/Dockerfile.9 +++ b/Dockerfile.9 @@ -66,19 +66,21 @@ ENV HOSTNAME="casjaysdevdocker-almalinux" USER ${USER} WORKDIR /root +COPY ./rootfs/usr/local/bin/. /usr/local/bin/ + RUN set -e; \ echo "Setting up prerequisites"; \ yum makecache && yum install -yy bash; \ SH_CMD="$(which sh 2>/dev/null)"; \ BASH_CMD="$(which bash 2>/dev/null)"; \ - [ -x "$BASH_CMD" ] && { rm -Rf "$SH_CMD"|| true ;ln -s "$BASH_CMD" "$SH_CMD"; } || true; \ - [ -x "$BASH_CMD" ] && { rm -rf "/bin/sh" || true; } && ln -sf "$BASH_CMD" "/bin/sh" || true; \ - [ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'$BASH_CMD'|g' "/etc/passwd" || true + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && symlink "\$BASH_CMD" "/usr/bin/sh" || true; \ + [ -x "\$BASH_CMD" ] && [ "\$SH_CMD" != "/bin/sh"] && symlink "\$BASH_CMD" "\$SH_CMD" || true; \ + [ -n "\$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'\$BASH_CMD'|g' "/etc/passwd" || true ENV SHELL="/bin/bash" SHELL [ "/bin/bash", "-c" ] -COPY ./rootfs/usr/local/bin/. /usr/local/bin/ COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu RUN echo "Initializing the system"; \