File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ jobs:
157157 tags : |
158158 ghcr.io/${{ github.repository }}:${{ needs.Artefact-Version.outputs.artefact_version }}
159159 build-args : |
160- BASE_IMAGE=openjdk:21-jdk-slim
160+ BASE_IMAGE=eclipse-temurin:25
161161 JAR_FILENAME=${{ needs.Build.outputs.artefact_name }}.jar
162162
163163 Deploy :
@@ -178,6 +178,7 @@ jobs:
178178 "GROUP_ID": "uk.gov.hmcts.cp",
179179 "ARTIFACT_ID": "${{ env.REPO_NAME }}",
180180 "ARTIFACT_VERSION": "${{ needs.Artefact-Version.outputs.artefact_version }}",
181- "TARGET_REPOSITORY": "${{ github.repository }}"
181+ "TARGET_REPOSITORY": "${{ github.repository }}",
182+ "agentDemand": "ubuntu-j25",
183+ "baseImage": "hmcts/apm-services:25-jre"
182184 }
183-
Original file line number Diff line number Diff line change 1- # Dockerfile (project root)
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
25ARG BASE_IMAGE
36FROM ${BASE_IMAGE:-eclipse-temurin:25-jre}
47
58# install curl for debugging
69RUN apt-get update \
7- && apt-get install -y --no-install-recommends curl \
10+ && apt-get install -y curl \
811 && rm -rf /var/lib/apt/lists/*
912
10- # run as non-root
13+ # run as non-root ... group and user "app"
1114RUN groupadd -r app && useradd -r -g app app
1215WORKDIR /app
1316
14- # copy startup script and app jar file
17+ # ---- Application files ----
1518COPY docker/* /app/
1619COPY build/libs/*.jar /app/
1720COPY 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-
2422USER app
2523ENTRYPOINT ["/bin/sh" ,"./startup.sh" ]
Original file line number Diff line number Diff line change 11#! /usr/bin/env sh
2- # Script to perform any custom docker startup actions
3- # Allows local running where the jarfile is under ./build/lib
4- # or dockerfile running where the app jarfile is under /app
5- #
2+ # Add any startup requirements in here
63logmsg () {
74 SCRIPTNAME=$( basename $0 )
85 echo " $SCRIPTNAME : $1 "
96}
107
11- logmsg " running and loading certificates ..."
12- if [ -z " $JAVA_HOME " ]; then
13- export JAVA_HOME=" /usr/local/openjdk-21"
14- fi
15- export KEYSTORE=" $JAVA_HOME /lib/security/cacerts"
16- if [ -z " $CERTS_DIR " ]; then
17- logmsg " Warning - expects \$ CERTS_DIR to be set. i.e. export CERTS_DIR=" /etc/certs
18- logmsg " Defaulting to /etc/certs"
19- export CERTS_DIR=" /etc/certs"
20- fi
21-
22- if [ ! -f " $KEYSTORE " ]; then
23- logmsg " Error - expects keystore $KEYSTORE to already exist"
24- exit 1
25- fi
26-
27- export count=1
28- logmsg " Loading certificates from $CERTS_DIR into keystore $KEYSTORE "
29- for FILE in $( ls $CERTS_DIR )
30- do
31- alias=" mojcert$count "
32- logmsg " Adding $CERTS_DIR /$FILE to keystore with alias $alias "
33- keytool -importcert -file $CERTS_DIR /$FILE -keystore $KEYSTORE -storepass changeit -alias $alias -noprompt
34- count=$(( count+ 1 ))
35- done
36-
37- keytool -list -keystore $KEYSTORE -storepass changeit | grep " Your keystore contains"
38-
398export LOCALJARFILE=$( ls ./build/libs/* .jar 2> /dev/null | grep -v ' plain' | head -n1)
409export DOCKERJARFILE=$( ls /app/* .jar 2> /dev/null | grep -v ' plain' | head -n1)
4110if [ -f " $DOCKERJARFILE " ]; then
You can’t perform that action at this time.
0 commit comments