Last active
January 9, 2024 01:31
-
-
Save maxisandoval37/0bf9c293a2a2c1b1a8df8e618049be2c to your computer and use it in GitHub Desktop.
Dockerfile for Maven java
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
# --Dockerfile for Maven java--- | |
FROM ubuntu:latest AS build | |
RUN apt-get update | |
RUN apt-get install openjdk-17-jdk -y | |
COPY . . | |
RUN chmod +x mvnw | |
RUN chmod +x ./mvnw | |
RUN ./mvnw dependency:go-offline -B | |
RUN ./mvnw clean package -DskipTests | |
FROM openjdk:17-jdk-slim | |
EXPOSE 8081 | |
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