Created
January 19, 2021 13:35
-
-
Save Musinux/f4be6a64950750c7c0053b043e7a4523 to your computer and use it in GitHub Desktop.
Dockerfile for building a java application
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:3.6.3-openjdk-16-slim | |
WORKDIR /app | |
COPY . /app | |
RUN mvn clean package | |
# copy the packaged jar file into our docker image | |
RUN cp target/*-SNAPSHOT.jar /app/app.jar | |
# set the startup command to execute the jar | |
CMD ["java", "-jar", "/app/app.jar"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment