Created
July 1, 2019 15:49
-
-
Save recursivecodes/3393b146c6ca259f237f28690ddb6b13 to your computer and use it in GitHub Desktop.
Dockerfile
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
# 1st stage, build the app | |
FROM maven:3.5.4-jdk-9 as build | |
WORKDIR /helidon | |
# Create a first layer to cache the "Maven World" in the local repository. | |
# Incremental docker builds will always resume after that, unless you update | |
# the pom | |
ADD pom.xml . | |
RUN mvn package -DskipTests | |
# Do the Maven build! | |
# Incremental docker builds will resume here when you change sources | |
ADD src src | |
RUN mvn package -DskipTests | |
RUN echo "done!" | |
# 2nd stage, build the runtime image | |
FROM openjdk:8-jre-slim | |
WORKDIR /helidon | |
# Copy the binary built in the 1st stage | |
COPY --from=build /helidon/target/user-svc.jar ./ | |
COPY --from=build /helidon/target/libs ./libs | |
CMD ["java", "-jar", "user-svc.jar"] | |
EXPOSE 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment