Created
December 6, 2022 19:36
-
-
Save ricardoapaes/12fadba83db9faf5ce6236c04e7547d2 to your computer and use it in GitHub Desktop.
Dockerfile: Build using maven with Amazon Correto 11 (multistage)
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
FROM maven:amazoncorretto as jar | |
WORKDIR /home/app/ | |
COPY pom.xml . | |
RUN mvn -f pom.xml dependency:go-offline -B | |
COPY src src | |
RUN mvn -f pom.xml package | |
RUN mkdir -p /home/app/output/ \ | |
&& mv target/dist/*-jar-with-dependencies.jar /home/app/output/app.jar | |
FROM amazoncorretto:11 | |
WORKDIR /app/ | |
ENV TZ="America/Fortaleza" | |
COPY --from=jar /home/app/output/app.jar . | |
COPY run.sh /usr/local/bin | |
RUN chmod +x /usr/local/bin/run.sh | |
ENTRYPOINT [ "run.sh" ] |
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
#!/bin/bash | |
java -jar -Djava.library.path=/app/ -XX:+UseContainerSupport -XX:MaxRAMPercentage=90 app.jar ${1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment