Skip to content

Commit 3a89933

Browse files
der-eismannvladak
authored andcommitted
Use Maven wrapper for container builds
1 parent e8995a2 commit 3a89933

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
FROM ubuntu:jammy as build
55

66
# hadolint ignore=DL3008
7-
RUN apt-get update && apt-get install --no-install-recommends -y maven python3 python3-venv && \
7+
RUN apt-get update && apt-get install --no-install-recommends -y openjdk-11-jdk python3 python3-venv && \
88
apt-get clean && \
99
rm -rf /var/lib/apt/lists/*
1010

1111
# Create a first layer to cache the "Maven World" in the local repository.
1212
# Incremental docker builds will always resume after that, unless you update the pom
1313
WORKDIR /mvn
1414
COPY pom.xml /mvn/
15+
COPY mvnw /mvn/
16+
COPY .mvn /mvn/.mvn
1517
COPY opengrok-indexer/pom.xml /mvn/opengrok-indexer/
1618
COPY opengrok-web/pom.xml /mvn/opengrok-web/
1719
COPY plugins/pom.xml /mvn/plugins/
@@ -26,18 +28,18 @@ RUN sed -i 's:<module>distribution</module>::g' /mvn/pom.xml && \
2628
touch /mvn/opengrok-web/src/main/webapp/WEB-INF/web.xml
2729

2830
# dummy build to cache the dependencies
29-
RUN mvn -DskipTests -Dcheckstyle.skip -Dmaven.antrun.skip package
31+
RUN ./mvnw -DskipTests -Dcheckstyle.skip -Dmaven.antrun.skip package
3032

3133
# build the project
3234
COPY ./ /opengrok-source
3335
WORKDIR /opengrok-source
3436

35-
RUN mvn -DskipTests=true -Dmaven.javadoc.skip=true -B -V package
37+
RUN /mvn/mvnw -DskipTests=true -Dmaven.javadoc.skip=true -B -V package
3638
# hadolint ignore=SC2012,DL4006
3739
RUN cp `ls -t distribution/target/*.tar.gz | head -1` /opengrok.tar.gz
3840

3941
# Store the version in a file so that the tools can report it.
40-
RUN mvn help:evaluate -Dexpression=project.version -q -DforceStdout > /mvn/VERSION
42+
RUN /mvn/mvnw help:evaluate -Dexpression=project.version -q -DforceStdout > /mvn/VERSION
4143

4244
FROM tomcat:10.1-jdk11
4345
LABEL maintainer="https://github.com/oracle/opengrok"

0 commit comments

Comments
 (0)