-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker] Update root Dockerfile (#6870)
- Loading branch information
1 parent
04ee374
commit ebb96cb
Showing
1 changed file
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
FROM jimschubert/8-jdk-alpine-mvn:1.0 | ||
|
||
ENV GEN_DIR /opt/swagger-codegen | ||
|
||
RUN set -x && \ | ||
apk add --no-cache bash | ||
|
||
RUN mkdir /opt | ||
ENV GEN_DIR /opt/swagger-codegen | ||
WORKDIR ${GEN_DIR} | ||
VOLUME ${MAVEN_HOME}/.m2/repository | ||
|
||
ADD . ${GEN_DIR} | ||
# Required from a licensing standpoint | ||
COPY ./LICENSE ${GEN_DIR} | ||
|
||
VOLUME ${MAVEN_HOME}/.m2/repository | ||
# Required to compile swagger-codegen | ||
COPY ./google_checkstyle.xml ${GEN_DIR} | ||
|
||
WORKDIR ${GEN_DIR} | ||
# 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 ./pom.xml ${GEN_DIR} | ||
|
||
# Pre-compile swagger-codegen-cli | ||
RUN mvn -am -pl "modules/swagger-codegen-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/ | ||
|
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
CMD ["build"] | ||
CMD ["help"] |