From bc72f034a7034fb72455cc531f873afed7f940e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meier?= Date: Wed, 30 Oct 2024 11:07:32 +0100 Subject: [PATCH] Setup java 17 and cleanup in Dockerfiles. --- .github/workflows/docker-image.yml | 6 +++--- Dockerfile | 1 - Dockerfile-REST | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f457534..cade5a2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -39,13 +39,13 @@ jobs: # set dev tag for dev branch type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev'}} - - name: Go Build Cache for Docker + name: Maven Build Cache for Docker uses: actions/cache@v4 with: path: maven-cache key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }} - - - name: inject go-build-cache into docker + - + name: Inject Maven Build Cache into Docker uses: reproducible-containers/buildkit-cache-dance@v3.1.0 with: cache-map: | diff --git a/Dockerfile b/Dockerfile index ff75f15..d27a988 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ COPY pom.xml /MetFragRelaunched/ RUN printf '# local database file folder \n\ LocalDatabasesFolderForWeb = /vol/file_databases' > /MetFragRelaunched/MetFragWeb/src/main/webapp/resources/settings.properties -# Cache Maven dependencies using a named cache RUN --mount=type=cache,target=/root/.m2 mvn -f MetFragRelaunched clean package -pl MetFragWeb -am -DskipTests FROM alpine:latest AS downloader diff --git a/Dockerfile-REST b/Dockerfile-REST index 1e17e20..30e7716 100644 --- a/Dockerfile-REST +++ b/Dockerfile-REST @@ -1,4 +1,4 @@ -FROM maven:3-jdk-11 AS builder +FROM maven:3.8-eclipse-temurin-17 AS builder COPY MetFragLib/ /MetFragRelaunched/MetFragLib/ COPY MetFragCommandLine/ /MetFragRelaunched/MetFragCommandLine/ @@ -11,11 +11,10 @@ COPY pom.xml /MetFragRelaunched/ RUN printf '# local database file folder \n\ LocalDatabasesFolderForWeb = /vol/file_databases' > /MetFragRelaunched/MetFragWeb/src/main/webapp/resources/settings.properties -RUN mvn -Dhttps.protocols=TLSv1.2 -f MetFragRelaunched clean package -pl MetFragLib -pl MetFragRest -am -DskipTests - +RUN --mount=type=cache,target=/root/.m2 mvn -f MetFragRelaunched clean package -pl MetFragRest -am -DskipTests #FROM tomee:8 -FROM maven:3-jdk-11 +FROM eclipse-temurin:17 RUN set -eux; \ apt-get update; \