content: # Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
  # file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
  # to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
  # License. You may obtain a copy of the License at
  #
  # http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  # specific language governing permissions and limitations under the License.
  
  # Build image used for github actions
  FROM eclipse-temurin:11-jdk
  
  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 -s /home/gradle/.gradle /root/.gradle
  
  VOLUME /home/gradle/.gradle
  
  WORKDIR /home/gradle
  
  RUN apt-get update \
      && apt-get install --yes --no-install-recommends \
          fontconfig \
          unzip \
          wget \
          \
          bzr \
          git \
          git-lfs \
          mercurial \
          openssh-client \
          subversion \
      && rm -rf /var/lib/apt/lists/* \
      \
      && echo "Testing VCSes" \
      && which bzr \
      && which git \
      && which git-lfs \
      && which hg \
      && which svn
  
  ENV GRADLE_VERSION 7.6
  ARG GRADLE_DOWNLOAD_SHA256=7ba68c54029790ab444b39d7e293d3236b2632631fb5f2e012bb28b4ff669e4b
  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 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 \
      \
      && echo "Testing Gradle installation" \
      && gradle --version
  
  RUN apt-get update && apt-get install -y libsodium-dev gpg && apt-get clean