-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
manage - oidcng - myconext: Use old cacert entrypoint update script
This reverts the new cacert update script, which leads to errors when restarting a container. See also: adoptium/containers#612
- Loading branch information
Showing
6 changed files
with
130 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
# Converted to POSIX shell to avoid the need for bash in the image | ||
|
||
set -e | ||
|
||
# Opt-in is only activated if the environment variable is set | ||
if [ -n "$USE_SYSTEM_CA_CERTS" ]; then | ||
|
||
# Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. | ||
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the | ||
# system location, for whatever reason. | ||
if [ -d /certificates ] && [ -n "$(ls -A /certificates 2>/dev/null)" ]; then | ||
cp -a /certificates/* /usr/local/share/ca-certificates/ | ||
fi | ||
|
||
CACERT="$JAVA_HOME/lib/security/cacerts" | ||
|
||
# JDK8 puts its JRE in a subdirectory | ||
if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then | ||
CACERT="$JAVA_HOME/jre/lib/security/cacerts" | ||
fi | ||
|
||
# OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we | ||
# might as well just generate the truststore and skip the hooks. | ||
update-ca-certificates | ||
|
||
trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
# Converted to POSIX shell to avoid the need for bash in the image | ||
|
||
set -e | ||
|
||
# Opt-in is only activated if the environment variable is set | ||
if [ -n "$USE_SYSTEM_CA_CERTS" ]; then | ||
|
||
# Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. | ||
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the | ||
# system location, for whatever reason. | ||
if [ -d /certificates ] && [ -n "$(ls -A /certificates 2>/dev/null)" ]; then | ||
cp -a /certificates/* /usr/local/share/ca-certificates/ | ||
fi | ||
|
||
CACERT="$JAVA_HOME/lib/security/cacerts" | ||
|
||
# JDK8 puts its JRE in a subdirectory | ||
if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then | ||
CACERT="$JAVA_HOME/jre/lib/security/cacerts" | ||
fi | ||
|
||
# OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we | ||
# might as well just generate the truststore and skip the hooks. | ||
update-ca-certificates | ||
|
||
trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
# Converted to POSIX shell to avoid the need for bash in the image | ||
|
||
set -e | ||
|
||
# Opt-in is only activated if the environment variable is set | ||
if [ -n "$USE_SYSTEM_CA_CERTS" ]; then | ||
|
||
# Copy certificates from /certificates to the system truststore, but only if the directory exists and is not empty. | ||
# The reason why this is not part of the opt-in is because it leaves open the option to mount certificates at the | ||
# system location, for whatever reason. | ||
if [ -d /certificates ] && [ -n "$(ls -A /certificates 2>/dev/null)" ]; then | ||
cp -a /certificates/* /usr/local/share/ca-certificates/ | ||
fi | ||
|
||
CACERT="$JAVA_HOME/lib/security/cacerts" | ||
|
||
# JDK8 puts its JRE in a subdirectory | ||
if [ -f "$JAVA_HOME/jre/lib/security/cacerts" ]; then | ||
CACERT="$JAVA_HOME/jre/lib/security/cacerts" | ||
fi | ||
|
||
# OpenJDK images used to create a hook for `update-ca-certificates`. Since we are using an entrypoint anyway, we | ||
# might as well just generate the truststore and skip the hooks. | ||
update-ca-certificates | ||
|
||
trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$CACERT" | ||
fi | ||
|
||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters