Skip to content

Commit da36c80

Browse files
dregladfrantuma
authored andcommitted
Add GEN_DIR Build Argument to Dockerfile
1 parent 85108f5 commit da36c80

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

Diff for: Dockerfile

+11-9
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,25 @@ FROM maven:3-eclipse-temurin-11-alpine
33
RUN set -x && \
44
apk add --no-cache bash
55

6-
ENV GEN_DIR /opt/swagger-codegen
6+
ARG GEN_DIR /opt/swagger-codegen
7+
ENV GEN_DIR ${GEN_DIR}
78
WORKDIR ${GEN_DIR}
8-
VOLUME ${MAVEN_HOME}/.m2/repository
9+
10+
VOLUME ${MAVEN_HOME}/.m2/repository
911

1012
# Required from a licensing standpoint
11-
COPY ./LICENSE ${GEN_DIR}
13+
COPY ./LICENSE ./
1214

1315
# Required to compile swagger-codegen
14-
COPY ./google_checkstyle.xml ${GEN_DIR}
16+
COPY ./google_checkstyle.xml ./
1517

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

2426
# Pre-compile swagger-codegen-cli
2527
RUN mvn -am -pl "modules/swagger-codegen-cli" package

0 commit comments

Comments
 (0)