The original article is hosted on my website here, so for my first article, I’ll keep it short, with step-by-step explanation.

TL;DR

You can check the sample repository, or here is the full Dockerfile:

FROM amazoncorretto:25-alpine-full AS build

WORKDIR /usr/src/project

ENV JAVA_VERSION=25
ENV APP_NAME=app.jar
ENV DEPS_FILE=deps.info

COPY pom.xml mvnw ./
COPY .mvn/ .mvn/
RUN chmod +x mvnw

RUN ./mvnw dependency:go-offline

COPY src/ src/

RUN ./mvnw clean package -DskipTests

RUN jar xf target/${APP_NAME}

RUN jdeps  \
--ignore-missing-deps  \
-q --recursive  \
--multi-release ${JAVA_VERSION} \
--print-module-deps  \
--class-path 'BOOT-INF/lib/*' \
target/${APP_NAM...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help