diff --git a/jdk11-alpine/Dockerfile b/jdk11-alpine/Dockerfile index 65d8a82f..5aca3131 100644 --- a/jdk11-alpine/Dockerfile +++ b/jdk11-alpine/Dockerfile @@ -45,7 +45,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ && gradle --version + +USER root diff --git a/jdk11-focal/Dockerfile b/jdk11-focal/Dockerfile index 384b44e4..1d48a132 100644 --- a/jdk11-focal/Dockerfile +++ b/jdk11-focal/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk11/Dockerfile b/jdk11/Dockerfile index 4590a8f3..74f18776 100644 --- a/jdk11/Dockerfile +++ b/jdk11/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk17-alpine/Dockerfile b/jdk17-alpine/Dockerfile index d4f62bca..0e358471 100644 --- a/jdk17-alpine/Dockerfile +++ b/jdk17-alpine/Dockerfile @@ -45,7 +45,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ && gradle --version + +USER root diff --git a/jdk17-focal-graal/Dockerfile b/jdk17-focal-graal/Dockerfile index 91e099a0..89b31a81 100644 --- a/jdk17-focal-graal/Dockerfile +++ b/jdk17-focal-graal/Dockerfile @@ -9,6 +9,7 @@ RUN set -o errexit -o nounset \ && 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 @@ -96,10 +97,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ - && gradle --version \ - \ - # chown last so that it applies to /home/gradle/.gradle/native - && chown --recursive gradle:gradle /home/gradle + && gradle --version + +USER root diff --git a/jdk17-focal/Dockerfile b/jdk17-focal/Dockerfile index f861fe00..602bb00a 100644 --- a/jdk17-focal/Dockerfile +++ b/jdk17-focal/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk17-graal/Dockerfile b/jdk17-graal/Dockerfile index b3b87449..969d9d85 100644 --- a/jdk17-graal/Dockerfile +++ b/jdk17-graal/Dockerfile @@ -9,6 +9,7 @@ RUN set -o errexit -o nounset \ && 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 @@ -96,10 +97,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ - && gradle --version \ - \ - # chown last so that it applies to /home/gradle/.gradle/native - && chown --recursive gradle:gradle /home/gradle + && gradle --version + +USER root diff --git a/jdk17/Dockerfile b/jdk17/Dockerfile index 002ae401..c7ea5cec 100644 --- a/jdk17/Dockerfile +++ b/jdk17/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk20-alpine/Dockerfile b/jdk20-alpine/Dockerfile index 16d6d8e5..d45df564 100644 --- a/jdk20-alpine/Dockerfile +++ b/jdk20-alpine/Dockerfile @@ -45,7 +45,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ && gradle --version + +USER root diff --git a/jdk20-graal/Dockerfile b/jdk20-graal/Dockerfile index 379b8339..a30a150a 100644 --- a/jdk20-graal/Dockerfile +++ b/jdk20-graal/Dockerfile @@ -9,6 +9,7 @@ RUN set -o errexit -o nounset \ && 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 @@ -96,10 +97,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle + +USER gradle + +RUN set -o errexit -o nounset \ && echo "Testing Gradle installation" \ - && gradle --version \ - \ - # chown last so that it applies to /home/gradle/.gradle/native - && chown --recursive gradle:gradle /home/gradle + && gradle --version + +USER root diff --git a/jdk20/Dockerfile b/jdk20/Dockerfile index 67c30516..367487cd 100644 --- a/jdk20/Dockerfile +++ b/jdk20/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk8-focal/Dockerfile b/jdk8-focal/Dockerfile index e541163f..a9734503 100644 --- a/jdk8-focal/Dockerfile +++ b/jdk8-focal/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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 diff --git a/jdk8/Dockerfile b/jdk8/Dockerfile index f1ecba96..98e1c123 100644 --- a/jdk8/Dockerfile +++ b/jdk8/Dockerfile @@ -52,7 +52,12 @@ RUN set -o errexit -o nounset \ && unzip gradle.zip \ && rm gradle.zip \ && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln --symbolic "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle \ - \ + && 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