diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index b52ce072c0d5..c09be51c16be 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -1,6 +1,7 @@ name: Docker tests on: + workflow_dispatch: push: paths: - Dockerfile @@ -27,7 +28,7 @@ jobs: shell: bash run: | sed -i 's/ -it / /g' run-in-docker.sh - ./run-in-docker.sh mvn clean install + ./run-in-docker.sh mvn -B clean install - name: Build Dockerfile shell: bash diff --git a/.hub.cli.dockerfile b/.hub.cli.dockerfile index fe18ad8dd3f8..5a3041dc1084 100644 --- a/.hub.cli.dockerfile +++ b/.hub.cli.dockerfile @@ -3,19 +3,19 @@ ## ## You can build _just_ this part with: ## docker --target builder -t container-name:builder -f .hub.cli.dockerfile . -FROM maven:3.6.3-jdk-11-openj9 as builder +FROM maven:3-eclipse-temurin-17 as builder ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} COPY . ${GEN_DIR} # Pre-compile openapi-generator-cli -RUN mvn -am -pl "modules/openapi-generator-cli" package +RUN mvn -B -am -pl "modules/openapi-generator-cli" package ## The final (release) image ## The resulting container here only needs the target jar ## and ca-certificates (to be able to query HTTPS hosted specs) -FROM openjdk:11.0.8-jre-slim-buster +FROM eclipse-temurin:17-jre ENV GEN_DIR /opt/openapi-generator diff --git a/.hub.online.dockerfile b/.hub.online.dockerfile index 4c7e01e3a24a..1d0b3a4aeed6 100644 --- a/.hub.online.dockerfile +++ b/.hub.online.dockerfile @@ -3,18 +3,18 @@ ## ## You can build _just_ this part with: ## docker --target builder -t container-name:builder -f .hub.online.dockerfile . -FROM maven:3.6.3-jdk-11-openj9 as builder +FROM maven:3-eclipse-temurin-17 as builder ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} COPY . ${GEN_DIR} # Pre-compile openapi-generator-online -RUN mvn -am -pl "modules/openapi-generator-online" package +RUN mvn -B -am -pl "modules/openapi-generator-online" package ## The final (release) image ## The resulting container here only needs the target jar -FROM openjdk:11.0.8-jre-slim-buster +FROM eclipse-temurin:17-jre ENV GEN_DIR /opt/openapi-generator ENV TARGET_DIR /generator diff --git a/Dockerfile b/Dockerfile index b1ca47344ed0..163f62d45d4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM maven:3.6.3-jdk-11-openj9 +FROM maven:3-eclipse-temurin-17 ENV GEN_DIR /opt/openapi-generator WORKDIR ${GEN_DIR} @@ -20,7 +20,7 @@ COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator COPY ./pom.xml ${GEN_DIR} # Pre-compile openapi-generator-cli -RUN mvn -am -pl "modules/openapi-generator-cli" package +RUN mvn -B -am -pl "modules/openapi-generator-cli" package # This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh. COPY docker-entrypoint.sh /usr/local/bin/ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5091cf3996d6..4590b56ce65d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -4,7 +4,7 @@ set -euo pipefail # GEN_DIR allows to share the entrypoint between Dockerfile and run-in-docker.sh (backward compatible) GEN_DIR=${GEN_DIR:-/opt/openapi-generator} -JAVA_OPTS=${JAVA_OPTS:-"-Xmx1024M -DloggerPath=conf/log4j.properties"} +JAVA_OPTS=${JAVA_OPTS:-"-DloggerPath=conf/log4j.properties"} cli="${GEN_DIR}/modules/openapi-generator-cli" codegen="${cli}/target/openapi-generator-cli.jar" diff --git a/run-in-docker.sh b/run-in-docker.sh index bdfa80b0ef53..077a9c972a56 100755 --- a/run-in-docker.sh +++ b/run-in-docker.sh @@ -15,10 +15,10 @@ docker run --rm -it \ -w /gen \ -e GEN_DIR=/gen \ -e MAVEN_CONFIG=/var/maven/.m2 \ - -e MAVEN_OPTS="-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=/var/maven/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Djacoco.skip=true" \ + -e MAVEN_OPTS="-Dmaven.repo.local=/var/maven/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true -Djacoco.skip=true" \ -u "$(id -u):$(id -g)" \ -v "${PWD}:/gen" \ -v "${PWD}/CI/run-in-docker-settings.xml:/var/maven/.m2/settings.xml" \ -v "${maven_cache_repo}:/var/maven/.m2/repository" \ --entrypoint /gen/docker-entrypoint.sh \ - maven:3-jdk-11 "$@" + maven:3-eclipse-temurin-17 "$@"