Permalink
Browse files

[docker] Cleanup and reduce container sizes

  • Loading branch information...
jimschubert committed May 24, 2016
1 parent 917192e commit 1da350e8197a0f27fdea7b158a85a7bfe0dbef7b
Showing with 21 additions and 38 deletions.
  1. +9 −30 .dockerignore
  2. +9 −6 Dockerfile
  3. +3 −2 modules/swagger-generator/Dockerfile
@@ -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/*
@@ -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"]
@@ -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"]

0 comments on commit 1da350e

Please sign in to comment.