Skip to content

Instantly share code, notes, and snippets.

@lucas-dclrcq
Last active May 24, 2018 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucas-dclrcq/35455b02d7125fc2517a854a095f6536 to your computer and use it in GitHub Desktop.
Save lucas-dclrcq/35455b02d7125fc2517a854a095f6536 to your computer and use it in GitHub Desktop.
Spring Boot Java 10 Multi Stage Docker Build
### STAGE 1: Build ###
FROM maven:3.5.3-jdk-10-slim as build
COPY src /usr/src/app/src
COPY pom.xml /usr/src/app
RUN mvn -f /usr/src/app/pom.xml clean package
### STAGE 2: Setup ###
FROM openjdk:10.0.1-10-jdk-sid
COPY --from=build \
/usr/src/app/target/*.jar /usr/app/app.jar
EXPOSE 8080
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","app.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment