forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker] Cleanup and reduce container sizes
- Loading branch information
1 parent
917192e
commit 1da350e
Showing
3 changed files
with
21 additions
and
38 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
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,13 +1,16 @@ | ||
FROM maven:3.3-jdk-7 | ||
FROM jimschubert/8-jdk-alpine-mvn | ||
|
||
WORKDIR /src | ||
VOLUME /src | ||
VOLUME /root/.m2/repository | ||
RUN mkdir /opt | ||
|
||
ADD . /opt/swagger-codegen | ||
|
||
RUN cd /opt/swagger-codegen && mvn package | ||
WORKDIR /opt/swagger-codegen | ||
|
||
ENTRYPOINT ["java", "-jar", "/opt/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"] | ||
RUN mvn -am -pl "modules/swagger-codegen-cli" package && \ | ||
mv /opt/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar /opt/swagger-codegen/swagger-codegen-cli.jar && \ | ||
mvn clean && \ | ||
rm -rf ${MAVEN_HOME}/.m2/repository | ||
|
||
ENTRYPOINT ["java", "-jar", "/opt/swagger-codegen/swagger-codegen-cli.jar"] | ||
|
||
CMD ["help"] |
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,12 +1,13 @@ | ||
FROM java:8-jdk | ||
FROM jimschubert/8-jdk-alpine-mvn | ||
|
||
WORKDIR /generator | ||
|
||
COPY target/lib/jetty-runner* /generator/jetty-runner.jar | ||
COPY target/*.war /generator/swagger-generator.war | ||
|
||
ENV GENERATOR_HOST=https://generator.swaggerhub.com/api/swagger.json | ||
RUN apt-get update | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["java", "-jar", "/generator/jetty-runner.jar", "/generator/swagger-generator.war"] | ||
|