Skip to content

Commit

Permalink
build: 使用gradle:8.4.0-jdk21的镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
damingerdai committed Nov 1, 2023
1 parent ed69e71 commit 9416d62
Showing 1 changed file with 1 addition and 66 deletions.
67 changes: 1 addition & 66 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,69 +1,4 @@
FROM openjdk:21-slim AS base

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 \
\
&& 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.4
ARG GRADLE_DOWNLOAD_SHA256=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
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

# FROM gradle:8.3.0-jdk20 AS builder
FROM base AS builder
FROM gradle:8.4.0-jdk21 AS builder

COPY src /usr/src/app/src
COPY *.gradle /usr/src/app/
Expand Down

0 comments on commit 9416d62

Please sign in to comment.