Skip to content

Commit 442db42

Browse files
authored
fix(rocklet): skip bash installation when already present in musl containers (#1219)
On customized Alpine images with a corrupted APK database, `apk add bash` returns a non-zero exit code even though bash is already installed. Combined with `set -o errexit`, this causes docker_run.sh to exit before installing the glibc compatibility layer or starting rocklet.
1 parent 77cb25d commit 442db42

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rock/rocklet/local_files/docker_run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if [ "$(is_musl)" = "true" ]; then
7777
fi
7878

7979
sed -i "s|https://.*alpinelinux.org|https://mirrors.aliyun.com|g" /etc/apk/repositories
80-
apk add bash
80+
command -v bash >/dev/null 2>&1 || apk add bash
8181
apk add --allow-untrusted --force-overwrite /tmp/local_files/alpine_glibc/*.apk
8282
mkdir -p /lib64
8383
ln -sf /usr/glibc-compat/lib/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2

0 commit comments

Comments
 (0)