From aaed846f5fb00fbddf930aa91c4f26ddf49e06a0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Nov 2023 11:08:31 +0800 Subject: [PATCH] Update Dockerfile (cli, online) to use eclipse-temurin:17.0.3_7-jre-focal (#17139) * add tests for openapi-generator-cli dockerfile * trigger workflow * add cp * restore * use eclipse-temurin:17.0.3_7-jre-focal * update dockerfile * update image to newer version --- .github/workflows/docker.yaml | 13 +++++++++++++ modules/openapi-generator-cli/Dockerfile | 2 +- modules/openapi-generator-cli/pom.xml | 7 ------- modules/openapi-generator-online/Dockerfile | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index c09be51c16b..c0e5dd3a483 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -9,6 +9,8 @@ on: - pom.xml - modules/openapi-generator-online/pom.xml - modules/openapi-generator-online/Dockerfile + - modules/openapi-generator-cli/pom.xml + - modules/openapi-generator-cli/Dockerfile pull_request: paths: - Dockerfile @@ -16,6 +18,8 @@ on: - pom.xml - modules/openapi-generator-online/pom.xml - modules/openapi-generator-online/Dockerfile + - modules/openapi-generator-cli/pom.xml + - modules/openapi-generator-cli/Dockerfile jobs: build: name: 'Build: Docker' @@ -38,3 +42,12 @@ jobs: shell: bash run: | docker build modules/openapi-generator-online/ -t test + - name: Build and test modules/openapi-generator-cli + shell: bash + run: | + cp docker-entrypoint.sh ./modules/openapi-generator-cli + docker build modules/openapi-generator-cli/ -t cli-test + docker run --rm -v "${PWD}:/local" cli-test generate \ + -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ + -g go \ + -o /local/out/go diff --git a/modules/openapi-generator-cli/Dockerfile b/modules/openapi-generator-cli/Dockerfile index 00fad3e7cdd..910eff85b9b 100644 --- a/modules/openapi-generator-cli/Dockerfile +++ b/modules/openapi-generator-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11.0-jre-buster +FROM eclipse-temurin:17.0.9_9-jre-focal ADD target/openapi-generator-cli.jar /opt/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 27ab614a44c..368756d9ac2 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -9,12 +9,9 @@ ../.. 4.0.0 - openapi-generator-cli jar - openapi-generator (executable) - openapi-generator-cli @@ -82,7 +79,6 @@ - static-analysis @@ -107,9 +103,7 @@ - - org.openapitools openapi-generator @@ -155,5 +149,4 @@ test - diff --git a/modules/openapi-generator-online/Dockerfile b/modules/openapi-generator-online/Dockerfile index 74ac8c6f980..806129c5ff5 100644 --- a/modules/openapi-generator-online/Dockerfile +++ b/modules/openapi-generator-online/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11 +FROM eclipse-temurin:17.0.9_9-jre-focal WORKDIR /generator