From aa0da27d5f2fef82339ca05352a729c3a1b810c7 Mon Sep 17 00:00:00 2001 From: Nikolai Prokoschenko Date: Mon, 14 Aug 2023 15:38:59 +0200 Subject: [PATCH 1/3] Relocate entrypoint script to a less common location This avoids clashing with pre-existing downstream images which have used a custom entrypoint script at e.g. /entrypoint.sh --- dockerfile_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile_functions.sh b/dockerfile_functions.sh index 4bc968ef4..140507e5f 100755 --- a/dockerfile_functions.sh +++ b/dockerfile_functions.sh @@ -855,8 +855,8 @@ print_entrypoint() { cat "scripts/entrypoint.$2.sh" > "$dir/entrypoint.sh" chmod +x "$dir/entrypoint.sh" cat >> "$1" < Date: Mon, 14 Aug 2023 15:39:56 +0200 Subject: [PATCH 2/3] Use bash as shebang in entrypoint scripts Ref: #415 --- dockerfile_functions.sh | 3 ++- scripts/entrypoint.alpine.sh | 3 ++- scripts/entrypoint.ubi9-minimal.sh | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dockerfile_functions.sh b/dockerfile_functions.sh index 140507e5f..62ec01e84 100755 --- a/dockerfile_functions.sh +++ b/dockerfile_functions.sh @@ -229,7 +229,8 @@ print_alpine_musl_pkg() { cat >> "$1" <<'EOI' # fontconfig and ttf-dejavu added to support serverside image generation by Java programs # java-cacerts added to support adding CA certificates to the Java keystore -RUN apk add --no-cache fontconfig java-cacerts libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ +# bash is required for the entrypoint script (s. https://github.com/adoptium/containers/issues/415) +RUN apk add --no-cache fontconfig java-cacerts bash libretls musl-locales musl-locales-lang ttf-dejavu tzdata zlib \ && rm -rf /var/cache/apk/* EOI } diff --git a/scripts/entrypoint.alpine.sh b/scripts/entrypoint.alpine.sh index 15bf4330d..dfcf546f9 100755 --- a/scripts/entrypoint.alpine.sh +++ b/scripts/entrypoint.alpine.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash +# Sheband needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details set -e diff --git a/scripts/entrypoint.ubi9-minimal.sh b/scripts/entrypoint.ubi9-minimal.sh index f2f6b5ffc..4d352111b 100755 --- a/scripts/entrypoint.ubi9-minimal.sh +++ b/scripts/entrypoint.ubi9-minimal.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# Sheband needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details set -e From b1af31e9042fe0bdc2a7c40b27777716f95ba5c4 Mon Sep 17 00:00:00 2001 From: George Adams Date: Mon, 14 Aug 2023 14:51:26 +0100 Subject: [PATCH 3/3] Apply suggestions from code review --- dockerfile_functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfile_functions.sh b/dockerfile_functions.sh index 62ec01e84..2bc1f80a9 100755 --- a/dockerfile_functions.sh +++ b/dockerfile_functions.sh @@ -856,8 +856,8 @@ print_entrypoint() { cat "scripts/entrypoint.$2.sh" > "$dir/entrypoint.sh" chmod +x "$dir/entrypoint.sh" cat >> "$1" <