[docker] Cleanup and reduce container sizes

This commit is contained in:
Jim Schubert 2016-05-23 21:54:35 -04:00
parent 917192e558
commit 1da350e819
3 changed files with 21 additions and 38 deletions

View File

@ -1,3 +1,4 @@
.git/
*.iml
out/
*.ipr
@ -13,35 +14,13 @@ generated-sources/*
generated-code/*
*.swp
*.swo
/target
/generated-files
/nbactions.xml
*.pyc
__pycache__
samples/server-generator/scalatra/output
samples/server-generator/node/output/node_modules
samples/server-generator/scalatra/target
samples/server-generator/scalatra/output/.history
samples/client/petstore/qt5cpp/PetStore/moc_*
samples/client/petstore/qt5cpp/PetStore/*.o
samples/client/petstore/objc/PetstoreClient.xcworkspace/xcuserdata
samples/client/petstore/qt5cpp/build-*
samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/java/hello.txt
samples/client/petstore/android/default/hello.txt
samples/client/petstore/objc/Build
samples/client/petstore/objc/Pods
samples/server/petstore/nodejs/node_modules
target
.idea
.lib
atlassian-ide-plugin.xml
*.bak
project/
samples/*
target/
.idea/
.lib/
.DS_Store
samples/client/petstore/php/SwaggerClient-php/composer.lock
samples/client/petstore/php/SwaggerClient-php/vendor/
samples/client/petstore/silex/SwaggerServer/composer.lock
samples/client/petstore/silex/SwaggerServer/venodr/
# Not needed in a linux container
bin/windows/*

View File

@ -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"]

View File

@ -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"]