Last active
August 5, 2025 03:10
-
-
Save maxisandoval37/0bf9c293a2a2c1b1a8df8e618049be2c to your computer and use it in GitHub Desktop.
Dockerfile for Maven java
This file contains hidden or 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
| # --Dockerfile for Maven Java JAR (jdk 17)--- | |
| FROM eclipse-temurin:17-jdk-alpine AS build | |
| COPY . . | |
| RUN chmod +x ./mvnw \ | |
| && ./mvnw dependency:go-offline -B \ | |
| && ./mvnw clean package -DskipTests | |
| FROM eclipse-temurin:17-jre-alpine | |
| EXPOSE 8080 | |
| COPY --from=build target/*.jar demo.jar | |
| ENTRYPOINT ["java", "-jar", "demo.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment