Skip to content

Instantly share code, notes, and snippets.

@srossillo
Created January 13, 2020 23:50
Show Gist options
  • Save srossillo/eadd240849a14385853b85440454be9e to your computer and use it in GitHub Desktop.
Save srossillo/eadd240849a14385853b85440454be9e to your computer and use it in GitHub Desktop.
Multi-Platform Dockerfiles
FROM --platform=$BUILDPLATFORM amazoncorretto:11 as builder
COPY . /srv/
WORKDIR /srv
RUN ./mvnw -DskipTests=true package spring-boot:repackage
FROM amazoncorretto:11
COPY --from=builder /srv/target/my-service-0.0.1-SNAPSHOT.jar /srv/
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/srv/my-service-0.0.1-SNAPSHOT.jar"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment