Skip to content

Commit

Permalink
Entrypoint fixes for CA certificates feature (#416)
Browse files Browse the repository at this point in the history
* 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

* Use bash as shebang in entrypoint scripts

Ref: #415

* Apply suggestions from code review

---------

Co-authored-by: George Adams <[email protected]>
  • Loading branch information
rassie and gdams authored Aug 14, 2023
1 parent 05b7f08 commit 79157bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions dockerfile_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -855,8 +856,8 @@ print_entrypoint() {
cat "scripts/entrypoint.$2.sh" > "$dir/entrypoint.sh"
chmod +x "$dir/entrypoint.sh"
cat >> "$1" <<EOI
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
COPY entrypoint.sh /__cacert_entrypoint.sh
ENTRYPOINT ["/__cacert_entrypoint.sh"]
EOI
}

Expand Down
3 changes: 2 additions & 1 deletion scripts/entrypoint.alpine.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions scripts/entrypoint.ubi9-minimal.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 79157bf

Please sign in to comment.