Skip to content

Commit 5c35265

Browse files
committed
feat: upgrade for java25
1 parent 7754560 commit 5c35265

File tree

3 files changed

+6
-51
lines changed

3 files changed

+6
-51
lines changed

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
# Docker base image - note that this is currently overwritten by azure pipelines
1+
# See ci-build-publish.yml which sets baseImage=hmcts/apm-services:25-jre and agentDemand:ubuntu-j25
2+
# azure pipeline replaces $BASE_IMAGE with crmdvrepo01.azurecr.io + $baseImage
3+
# This image has the hmcts self signing certificate authority added to truststore so we dont need to worry about about the certs
4+
# If pulling this locally we need to authenticate to acr ... az login; az acr login -n crmdvrepo01
25
ARG BASE_IMAGE
3-
FROM ${BASE_IMAGE:-eclipse-temurin:21-jdk}
6+
FROM ${BASE_IMAGE:-eclipse-temurin:25-jre}
47

58
# run as non-root ... group and user "app"
69
RUN groupadd -r app && useradd -r -g app app
@@ -16,10 +19,5 @@ COPY docker/* /app/
1619
COPY build/libs/*.jar /app/
1720
COPY lib/applicationinsights.json /app/
1821

19-
# Not sure this does anything useful we can drop once we sort certificates
20-
RUN test -n "$JAVA_HOME" \
21-
&& test -f "$JAVA_HOME/lib/security/cacerts" \
22-
&& chmod 777 "$JAVA_HOME/lib/security/cacerts"
23-
2422
USER app
2523
ENTRYPOINT ["/bin/sh","./startup.sh"]

docker/README-certs.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

docker/startup.sh

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,10 @@
11
#!/usr/bin/env sh
2-
# Script to add ssl trust certs into the current truststore / keystore before we start our spring boot app
3-
# We use self signed certificates in our dev and test environments so we need to add these to our chain of trust
4-
# The kubernetes startup will load any self signed certificates into /etc/certs
5-
# We load any certs found in the /etc/certs into the default keystore
6-
#
2+
# Add any startup requirements in here
73
logmsg() {
84
SCRIPTNAME=$(basename $0)
95
echo "$SCRIPTNAME : $1"
106
}
117

12-
logmsg "running and loading certificates ..."
13-
if [ -z "$JAVA_HOME" ]; then
14-
export JAVA_HOME="/usr/local/openjdk-21"
15-
fi
16-
export KEYSTORE="$JAVA_HOME/lib/security/cacerts"
17-
if [ -z "$CERTS_DIR" ]; then
18-
logmsg "Warning - expects \$CERTS_DIR to be set. i.e. export CERTS_DIR="/etc/certs
19-
logmsg "Defaulting to /etc/certs"
20-
export CERTS_DIR="/etc/certs"
21-
fi
22-
23-
if [ ! -f "$KEYSTORE" ]; then
24-
logmsg "Error - expects keystore $KEYSTORE to already exist"
25-
exit 1
26-
fi
27-
28-
export count=1
29-
logmsg "Loading certificates from $CERTS_DIR into keystore $KEYSTORE"
30-
for FILE in $(ls $CERTS_DIR)
31-
do
32-
alias="mojcert$count"
33-
logmsg "Adding $CERTS_DIR/$FILE to keystore with alias $alias"
34-
keytool -importcert -file $CERTS_DIR/$FILE -keystore $KEYSTORE -storepass changeit -alias $alias -noprompt
35-
count=$((count+1))
36-
done
37-
38-
keytool -list -keystore $KEYSTORE -storepass changeit | grep "Your keystore contains"
39-
408
export LOCALJARFILE=$(ls ./build/libs/*.jar 2>/dev/null | grep -v 'plain' | head -n1)
419
export DOCKERJARFILE=$(ls /app/*.jar 2>/dev/null | grep -v 'plain' | head -n1)
4210
if [ -f "$DOCKERJARFILE" ]; then

0 commit comments

Comments
 (0)