Skip to content

Commit

Permalink
i hate computers
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Nov 3, 2022
1 parent 4d661f2 commit ec6c106
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions images/java/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ec6c106

Please sign in to comment.