Skip to content

Commit

Permalink
Add GEN_DIR Build Argument to Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dreglad committed Apr 23, 2024
1 parent 4e16fb8 commit 4ae6848
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ FROM maven:3-eclipse-temurin-11-alpine
RUN set -x && \
apk add --no-cache bash

ENV GEN_DIR /opt/swagger-codegen
ARG GEN_DIR /opt/swagger-codegen
ENV GEN_DIR ${GEN_DIR}
WORKDIR ${GEN_DIR}
VOLUME ${MAVEN_HOME}/.m2/repository

VOLUME ${MAVEN_HOME}/.m2/repository

# Required from a licensing standpoint
COPY ./LICENSE ${GEN_DIR}
COPY ./LICENSE ./

# Required to compile swagger-codegen
COPY ./google_checkstyle.xml ${GEN_DIR}
COPY ./google_checkstyle.xml ./

# Modules are copied individually here to allow for caching of docker layers between major.minor versions
# NOTE: swagger-generator is not included here, it is available as swaggerapi/swagger-generator
COPY ./modules/swagger-codegen-maven-plugin ${GEN_DIR}/modules/swagger-codegen-maven-plugin
COPY ./modules/swagger-codegen-cli ${GEN_DIR}/modules/swagger-codegen-cli
COPY ./modules/swagger-codegen ${GEN_DIR}/modules/swagger-codegen
COPY ./modules/swagger-generator ${GEN_DIR}/modules/swagger-generator
COPY ./pom.xml ${GEN_DIR}
COPY ./modules/swagger-codegen-maven-plugin ./modules/swagger-codegen-maven-plugin
COPY ./modules/swagger-codegen-cli ./modules/swagger-codegen-cli
COPY ./modules/swagger-codegen ./modules/swagger-codegen
COPY ./modules/swagger-generator ./modules/swagger-generator
COPY ./pom.xml ./

# Pre-compile swagger-codegen-cli
RUN mvn -am -pl "modules/swagger-codegen-cli" package
Expand Down

0 comments on commit 4ae6848

Please sign in to comment.