-
Notifications
You must be signed in to change notification settings - Fork 72
/
Dockerfile
64 lines (54 loc) · 1.79 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM eclipse-temurin:8-jdk-jammy
CMD ["gradle"]
ENV GRADLE_HOME /opt/gradle
RUN set -o errexit -o nounset \
&& echo "Adding gradle user and group" \
&& groupadd --system --gid 1000 gradle \
&& useradd --system --gid gradle --uid 1000 --shell /bin/bash --create-home gradle \
&& mkdir /home/gradle/.gradle \
&& chown --recursive gradle:gradle /home/gradle \
&& chmod --recursive o+rwx /home/gradle \
\
&& echo "Symlinking root Gradle cache to gradle Gradle cache" \
&& ln --symbolic /home/gradle/.gradle /root/.gradle
VOLUME /home/gradle/.gradle
WORKDIR /home/gradle
RUN set -o errexit -o nounset \
&& apt-get update \
&& apt-get install --yes --no-install-recommends \
unzip \
wget \
\
bzr \
git \
git-lfs \
mercurial \
openssh-client \
subversion \
&& rm --recursive --force /var/lib/apt/lists/* \
\
&& echo "Testing VCSes" \
&& which bzr \
&& which git \
&& which git-lfs \
&& which hg \
&& which svn
ENV GRADLE_VERSION 8.8
ARG GRADLE_DOWNLOAD_SHA256=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
RUN set -o errexit -o nounset \
&& echo "Downloading Gradle" \
&& wget --no-verbose --output-document=gradle.zip "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \
\
&& echo "Checking Gradle download hash" \
&& echo "${GRADLE_DOWNLOAD_SHA256} *gradle.zip" | sha256sum --check - \
\
&& echo "Installing Gradle" \
&& unzip gradle.zip \
&& rm gradle.zip \
&& mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \
&& ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle
USER gradle
RUN set -o errexit -o nounset \
&& echo "Testing Gradle installation" \
&& gradle --version
USER root