-
Notifications
You must be signed in to change notification settings - Fork 416
/
Dockerfile
49 lines (38 loc) · 1.65 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM gradle:8.10.2-jdk11 AS builder
RUN --mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,target=/root/.cache \
apt-get update && \
apt-get install --yes --no-install-recommends fonts-liberation gettext curl
WORKDIR /src
ENV GRADLE_OPTS=-Dorg.gradle.daemon=false
# Generate the file `libnative-platform.so`
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle --version
COPY gradle/ ./gradle/
COPY gradle.properties build.gradle settings.gradle CI.asc ./
COPY examples/build.gradle ./examples/
COPY docs/build.gradle ./docs/
COPY publish/build.gradle ./publish/
COPY core ./core
COPY publish ./publish
COPY examples ./examples
COPY docs ./docs
ARG GIT_HEAD
ENV GIT_HEAD=${GIT_HEAD}
# Exclude the tasks that will run out of the docker build (in a docker run)
RUN --mount=type=cache,target=/home/gradle/.gradle \
gradle --parallel --exclude-task=:core:test \
--exclude-task=:core:spotbugsMain --exclude-task=:core:checkstyleMain \
--exclude-task=:core:spotbugsTest --exclude-task=:core:checkstyleTest --exclude-task=:core:testCLI \
:core:build :core:explodedWar :publish:build :examples:build :docs:buildDocs :core:libSourcesJar :core:libJavadocJar
RUN mkdir -p core/build/resources/test/org/mapfish/print/ \
&& chmod -R go=u /home/gradle /tmp/mapfish-print/ . \
&& chmod o+t -R core/build/resources
# Backup cache
RUN --mount=type=cache,target=/home/gradle/.gradle \
cp -r /home/gradle/.gradle /home/gradle/.gradle-backup
RUN mv /home/gradle/.gradle-backup /home/gradle/.gradle
# Be able to use the container with a different user
ENV GRADLE_USER_HOME=/home/gradle/
RUN chmod -R go+rw /home/gradle/
COPY checkstyle_* ./