2023-11-14 04:41:49 +01:00
FROM maven:3-eclipse-temurin-17
2016-05-24 23:21:50 -04:00
2018-05-11 05:41:42 +02:00
ENV GEN_DIR /opt/openapi-generator
2017-11-20 12:29:09 -05:00
WORKDIR ${GEN_DIR }
VOLUME ${ MAVEN_HOME } /.m2/repository
2015-07-09 01:21:59 +02:00
2017-11-20 12:29:09 -05:00
# Required from a licensing standpoint
COPY ./LICENSE ${ GEN_DIR }
2016-05-24 23:21:50 -04:00
2018-05-11 05:41:42 +02:00
# Required to compile openapi-generator
2017-11-20 12:29:09 -05:00
COPY ./google_checkstyle.xml ${ GEN_DIR }
2016-05-24 23:21:50 -04:00
2024-07-07 11:56:54 +03:00
# All poms are copied, then we go offline, to allow for better caching of code changes without fetching all dependencies each time
COPY ./modules/openapi-generator-gradle-plugin/pom.xml ${ GEN_DIR } /modules/openapi-generator-gradle-plugin/
COPY ./modules/openapi-generator-maven-plugin/pom.xml ${ GEN_DIR } /modules/openapi-generator-maven-plugin/
2026-01-20 20:48:12 +01:00
COPY ./modules/openapi-generator-mill-plugin/pom.xml ${ GEN_DIR } /modules/openapi-generator-mill-plugin/
2024-07-07 11:56:54 +03:00
COPY ./modules/openapi-generator-online/pom.xml ${ GEN_DIR } /modules/openapi-generator-online/
COPY ./modules/openapi-generator-cli/pom.xml ${ GEN_DIR } /modules/openapi-generator-cli/
COPY ./modules/openapi-generator-core/pom.xml ${ GEN_DIR } /modules/openapi-generator-core/
COPY ./modules/openapi-generator/pom.xml ${ GEN_DIR } /modules/openapi-generator/
COPY ./pom.xml ${ GEN_DIR }
RUN mvn dependency:go-offline
2017-11-20 12:29:09 -05:00
# Modules are copied individually here to allow for caching of docker layers between major.minor versions
2018-07-28 09:10:49 +01:00
COPY ./modules/openapi-generator-gradle-plugin ${ GEN_DIR } /modules/openapi-generator-gradle-plugin
2018-05-11 05:41:42 +02:00
COPY ./modules/openapi-generator-maven-plugin ${ GEN_DIR } /modules/openapi-generator-maven-plugin
2026-01-20 20:48:12 +01:00
COPY ./modules/openapi-generator-mill-plugin ${ GEN_DIR } /modules/openapi-generator-mill-plugin
2018-07-28 09:10:49 +01:00
COPY ./modules/openapi-generator-online ${ GEN_DIR } /modules/openapi-generator-online
2018-05-11 05:41:42 +02:00
COPY ./modules/openapi-generator-cli ${ GEN_DIR } /modules/openapi-generator-cli
2019-04-25 21:52:50 -04:00
COPY ./modules/openapi-generator-core ${ GEN_DIR } /modules/openapi-generator-core
2018-05-11 05:41:42 +02:00
COPY ./modules/openapi-generator ${ GEN_DIR } /modules/openapi-generator
2015-07-09 01:21:59 +02:00
2018-05-11 05:41:42 +02:00
# Pre-compile openapi-generator-cli
2023-11-14 04:41:49 +01:00
RUN mvn -B -am -pl "modules/openapi-generator-cli" package
2015-07-09 01:21:59 +02:00
2017-11-20 12:29:09 -05:00
# This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
2016-05-24 23:21:50 -04:00
COPY docker-entrypoint.sh /usr/local/bin/
2019-11-27 07:08:26 +01:00
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
2016-05-23 21:54:35 -04:00
2020-08-23 23:40:32 -04:00
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
2015-07-09 01:21:59 +02:00
2017-11-20 12:29:09 -05:00
CMD [ "help" ]