Created
October 10, 2022 08:20
-
-
Save ferdinand-beyer/1ea62d78d871c00da7e70d5a8c4c85d7 to your computer and use it in GitHub Desktop.
Java Dockerfile template
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
# | |
# Following the best practices described here: | |
# https://snyk.io/blog/best-practices-to-build-java-containers-with-docker/ | |
# | |
# Pinning the latest LTS (heree: '17-jre-alpine') | |
FROM eclipse-temurin:17.0.4.1_1-jre-alpine | |
RUN apk add dumb-init | |
RUN addgroup --system jvm && \ | |
adduser -S -s /bin/false -G jvm jvm | |
RUN mkdir /app && \ | |
chown -R jvm:jvm /app | |
WORKDIR /app | |
USER jvm | |
ENTRYPOINT ["/usr/bin/dumb-init", "--"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For focal: