From 39e919d46c6210eafbcf0ccc869b8a71462a928f Mon Sep 17 00:00:00 2001 From: Justin Black Date: Sun, 2 Oct 2022 14:07:07 -0700 Subject: [PATCH] Fixes entrypoint file --- .hub.cli.dockerfile | 32 -------------------------------- .hub.online.dockerfile | 32 -------------------------------- docker-entrypoint.sh | 8 ++++---- 3 files changed, 4 insertions(+), 68 deletions(-) delete mode 100644 .hub.cli.dockerfile delete mode 100644 .hub.online.dockerfile diff --git a/.hub.cli.dockerfile b/.hub.cli.dockerfile deleted file mode 100644 index fe18ad8dd3f..00000000000 --- a/.hub.cli.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -## The builder labeled image acts as a transient container which is meant to -## hold all non-artifact code. -## -## 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 - -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 - -## 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 - -ENV GEN_DIR /opt/openapi-generator - -RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target - -WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target - -COPY --from=builder ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar - -COPY docker-entrypoint.sh /usr/local/bin/ - -ENTRYPOINT ["docker-entrypoint.sh"] - -CMD ["help"] diff --git a/.hub.online.dockerfile b/.hub.online.dockerfile deleted file mode 100644 index 4c7e01e3a24..00000000000 --- a/.hub.online.dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -## The builder labeled image acts as a transient container which is meant to -## hold all non-artifact code. -## -## 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 - -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 - -## The final (release) image -## The resulting container here only needs the target jar -FROM openjdk:11.0.8-jre-slim-buster - -ENV GEN_DIR /opt/openapi-generator -ENV TARGET_DIR /generator - -RUN mkdir -p ${TARGET_DIR} - -WORKDIR ${TARGET_DIR} - -COPY --from=builder ${GEN_DIR}/modules/openapi-generator-online/target/openapi-generator-online.jar ${TARGET_DIR}/openapi-generator-online.jar - -ENV GENERATOR_HOST="" - -EXPOSE 8080 - -CMD ["java", "-jar", "/generator/openapi-generator-online.jar"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 5091cf3996d..0770853e11a 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,11 +3,11 @@ 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} +GEN_DIR=${GEN_DIR:-/opt/openapi-json-schema-generator} JAVA_OPTS=${JAVA_OPTS:-"-Xmx1024M -DloggerPath=conf/log4j.properties"} -cli="${GEN_DIR}/modules/openapi-generator-cli" -codegen="${cli}/target/openapi-generator-cli.jar" +cli="${GEN_DIR}/modules/openapi-json-schema-generator-cli" +codegen="${cli}/target/openapi-json-schema-generator-cli.jar" # We code in a list of commands here as source processing is potentially buggy (requires undocumented conventional use of annotations). # A list of known commands helps us determine if we should compile CLI. There's an edge-case where a new command not added to this @@ -31,7 +31,7 @@ if [[ -f "${codegen}" && -n "$(java ${JAVA_OPTS} -jar "${codegen}" completion | elif [[ -n "$(echo $commands | tr ',' '\n' | grep "^$1\$" )" ]]; then # If CLI jar does not exist, and $1 is a known CLI command, build the CLI jar and run that command. if [[ ! -f "${codegen}" ]]; then - (cd "${GEN_DIR}" && exec mvn -am -pl "modules/openapi-generator-cli" -Duser.home=$(dirname $MAVEN_CONFIG) package) + (cd "${GEN_DIR}" && exec mvn -am -pl "modules/openapi-json-schema-generator-cli" -Duser.home=$(dirname $MAVEN_CONFIG) package) fi command=$1 shift