Created
September 16, 2023 21:27
-
-
Save sombriks/2c810d07eca883dba179377be515b6cf to your computer and use it in GitHub Desktop.
dockerfile to package an already built jar file (src/infrastructure/Dockerfile)
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
# see https://gist.github.com/sombriks/c8e8979d80efaf02de6bf04ffe5805cc | |
FROM eclipse-temurin:17-jre-alpine | |
ARG SERVICE=my-service | |
ARG VERSION=0.0.1-SNAPSHOT | |
ENV SERVICE=$SERVICE | |
ENV VERSION=$VERSION | |
# for gradle | |
ADD ./build/libs/$SERVICE-$VERSION.jar /$SERVICE-$VERSION.jar | |
# for maven | |
# ADD ./target/$SERVICE-$VERSION.jar /$SERVICE-$VERSION.jar | |
ENTRYPOINT java -jar /$SERVICE-$VERSION.jar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment