Skip to content

Commit

Permalink
Use temurin base image
Browse files Browse the repository at this point in the history
  • Loading branch information
lucko committed Feb 28, 2024
1 parent aaea41d commit d696a40
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
# bytebin Dockerfile
# Copyright (c) lucko - licenced MIT

# --------------
# BUILD JRE STAGE
# --------------
FROM alpine as build-jre
RUN apk add --no-cache openjdk21 binutils

# create a minimal JRE
RUN jlink \
--add-modules java.base,java.logging,java.xml,java.desktop,java.management,java.sql,java.naming,jdk.unsupported \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /jre


# --------------
# BUILD PROJECT STAGE
# --------------
Expand All @@ -33,12 +17,7 @@ RUN mvn --no-transfer-progress -B package
# --------------
# RUN STAGE
# --------------
FROM alpine

# copy JRE from build stage
ENV JAVA_HOME=/opt/java
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=build-jre /jre $JAVA_HOME
FROM eclipse-temurin:21-alpine

RUN addgroup -S bytebin && adduser -S -G bytebin bytebin
USER bytebin
Expand Down

0 comments on commit d696a40

Please sign in to comment.