Skip to content

Commit

Permalink
upgrade to java 21 (temurin) and bump debian
Browse files Browse the repository at this point in the history
  • Loading branch information
andponlin committed Nov 15, 2023
1 parent ddca7fb commit a4070df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
32 changes: 20 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@
# -------------------------------------
# Assemble the build image with the dependencies

FROM debian:12.1-slim as build
FROM debian:12.2-slim as build

RUN apt-get update && \
apt-get -y install openjdk-17-jdk && \
apt-get -y install wget apt-transport-https gnupg

RUN wget -O - "https://packages.adoptium.net/artifactory/api/gpg/key/public" | apt-key add - && \
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list

# the handling here for `ca-certificates-java` is to get around a sequencing
# problem that comes up with GitHub actions.
RUN apt-get update && \
apt-get -y install temurin-21-jdk && \
apt-get -y install wget python3 fontconfig fonts-dejavu-core lsb-release gnupg2 && \
apt-get -y install postgresql postgresql-contrib

Expand All @@ -37,12 +45,7 @@ COPY ./haikudepotserver-core/pom.xml /hds-src/haikudepotserver-core/pom.xml

WORKDIR /hds-src

# capture the dependencies into the image
# [apl 2.apr.2023] temporary disabled owing to a missing `SNAPSHOT` dependency
# being used in the module. See here;
# https://github.com/micrometer-metrics/micrometer/issues/3738
# Re-enable this line once the problem is resolved.
# RUN ./mvnw clean org.apache.maven.plugins:maven-dependency-plugin:3.3.0:go-offline
RUN ./mvnw clean org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline

COPY ./haikudepotserver-spa1/package.json /hds-src/haikudepotserver-spa1/package.json

Expand Down Expand Up @@ -72,14 +75,19 @@ RUN ./mvnw clean install
# -------------------------------------
# Create the container that will eventually run HDS

FROM debian:12.1-slim AS runtime
FROM debian:12.2-slim AS runtime

RUN apt-get update && \
apt-get -y install wget apt-transport-https gnupg

RUN wget -O - "https://packages.adoptium.net/artifactory/api/gpg/key/public" | apt-key add - && \
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list

# the handling here for `ca-certificates-java` is to get around a sequencing
# problem that comes up with GitHub actions.
RUN apt-get update && \
apt-get -y install openjdk-17-jre && \
apt-get -y install wget optipng libpng16-16 curl fontconfig fonts-dejavu-core

apt-get -y install temurin-21-jre && \
apt-get -y install optipng libpng16-16 curl fontconfig fonts-dejavu-core

ENV HDS_B_HTTP_PORT=8080
ENV HDS_B_HTTP_ACTUATOR_PORT=8081
Expand Down
4 changes: 2 additions & 2 deletions haikudepotserver-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.parameters>true</maven.compiler.parameters>

<spring-boot.version>3.1.4</spring-boot.version>
Expand Down

0 comments on commit a4070df

Please sign in to comment.