Skip to content

Commit 0e45835

Browse files
committed
docker: Update comments in the Dockerfile
1 parent f892c67 commit 0e45835

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ WORKDIR /usr/src
66
COPY . .
77
# Wipe any files not called pom.xml or *.jar
88
RUN find . -type f -and \! -name pom.xml -and \! -name '*.jar' -delete
9-
# Drop the Maven wrapper jar: the build stage copies .mvn/wrapper in
10-
# separately, and keeping it here would let a wrapper-jar change
11-
# invalidate the pom-only dependency layer.
9+
# Drop the Maven wrapper jar from the `poms` stage output: the build stage copies `.mvn/wrapper` separately.
10+
# Keeping it here is redundant, and would make the `poms` stage output change when the wrapper jar changes.
11+
# (That output is later copied into the dependency-download layer.)
1212
RUN rm -f .mvn/wrapper/maven-wrapper.jar
1313
# Clear up any (now) empty diretories
1414
RUN find . -type d -empty -delete
@@ -23,8 +23,8 @@ RUN mkdir -p .mvn
2323
COPY .mvn/wrapper .mvn/wrapper
2424

2525
# First, copy in the pom.xml files (and any checked-in jars) and fetch the dependencies into a real image layer.
26-
# Because this layer depends only on the pom.xml files, it stays stable until a POM changes, so dependency
27-
# downloads are reused whenever the source changes but the dependencies don't.
26+
# Because this layer depends on the POMs (and the Maven wrapper scripts/config), it stays stable until one of those
27+
# inputs changes, so dependency downloads are reused whenever the source changes but the dependencies don't.
2828
COPY --from=poms /usr/src/ .
2929
# I don't know why we need all three either.
3030
RUN ./mvnw -e -B dependency:resolve-plugins -Dmaven.test.skip -Dmaven.repo.local=/tmp/m2_repo

0 commit comments

Comments
 (0)