-
-
Save anjilinux/7e8e01507c936930485af924ef8f1b4e to your computer and use it in GitHub Desktop.
Dockerfile for building a java application
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
| 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