diff --git a/images/java/Dockerfile b/images/java/Dockerfile index 7816464..fed2238 100644 --- a/images/java/Dockerfile +++ b/images/java/Dockerfile @@ -27,32 +27,24 @@ ENV USERNAME=noel USER root # Set version environment variables -ENV JDK_VERSION="18.0.2.1" ENV GRADLE_VERSION="7.5.1" ENV MAVEN_VERSION="3.8.6" -# boop -RUN DEBIAN_FRONTEND="noninteractive" apt install -y libarchive-tools +# install required things +RUN DEBIAN_FRONTEND="noninteractive" apt install -y wget libarchive-tools + +# Install Temurin 18 +RUN wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo apt-key add - +RUN echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list +RUN DEBIAN_FRONTEND="noninteractive" apt update && \ + DEBIAN_FRONTEND="noninteractive" apt install -y temurin-18-jdk # Install packages! -RUN set -eux; \ - arch="$(dpkg --print-architecture)"; \ - GRADLE_DOWNLOAD_URL="https://services.gradle.org/distributions/gradle-7.5.1-all.zip"; \ +RUN GRADLE_DOWNLOAD_URL="https://services.gradle.org/distributions/gradle-7.5.1-all.zip"; \ MAVEN_DOWNLOAD_URL="https://dlcdn.apache.org/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"; \ - case "${arch}" in \ - aarch64|arm64) \ - ARCH="arm64"; \ - TEMURIN_DOWNLOAD_URL="https://github.com/adoptium/temurin18-binaries/releases/download/jdk-${JDK_VERSION}+1/OpenJDK18U-jdk_arm_linux_hotspot_${JDK_VERSION}_1.tar.gz" \ - ;; \ - x86_64|amd64) \ - ARCH="amd64"; \ - TEMURIN_DOWNLOAD_URL="https://github.com/adoptium/temurin18-binaries/releases/download/jdk-${JDK_VERSION}+1/OpenJDK18U-jdk_x64_linux_hotspot_${JDK_VERSION}_1.tar.gz" \ - ;; \ - esac; \ mkdir -p /opt/java/jdk; \ mkdir -p /opt/gradle; \ mkdir -p /opt/maven; \ - curl -L -s ${TEMURIN_DOWNLOAD_URL} | tar xfz - -C /opt/java/jdk --strip-components=1; \ curl -L -s ${MAVEN_DOWNLOAD_URL} | tar xfz - -C /opt/maven --strip-components=1; \ curl -L -s ${GRADLE_DOWNLOAD_URL} | bsdtar xfz - --strip-components=1 -C /opt/gradle;