From 4984fcea1601525d0761f06ee96d8860543b0e4e Mon Sep 17 00:00:00 2001 From: casjay Date: Sat, 10 Aug 2024 19:59:55 -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 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 477acee..3d76afe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,9 +78,11 @@ RUN set -e; \ pacman-key --populate; \ echo "installing bash"; \ pacman -Sy --noconfirm bash; \ - BASH_CMD="$(command -v bash 2>/dev/null|| 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 + SH_CMD="$(which sh 2>/dev/null)"; \ + BASH_CMD="$(which bash 2>/dev/null)"; \ + [ -n "$BASH_CMD" ] && sed -i 's|root:x:.*|root:x:0:0:root:/root:'$BASH_CMD'|g' "/etc/passwd" || true; \ + [ -x "$BASH_CMD" ] && [ "$SH_CMD" != "/bin/sh" ] && { rm -Rf "$SH_CMD";ln -s "$BASH_CMD" "$SH_CMD"; } || true; \ + [ -x "$BASH_CMD" ] && [ ! -L "/bin/sh" ] && { rm -rf "/bin/sh" || true; } && ln -sf "$BASH_CMD" "/bin/sh" || true ENV SHELL="/bin/bash" SHELL [ "/bin/bash", "-c" ]