Skip to content

Commit

Permalink
Add Java and Gradle installation to build Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
QU3B1M committed Nov 21, 2024
1 parent 4c6c712 commit cc5ddde
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions docker/builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
FROM ubuntu:noble

# Install required packages
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install curl gnupg2 -y && \
apt-get clean -y
# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive

# Update the package list and install necessary tools
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
wget \
curl \
unzip \
gnupg2

# Install OpenJDK 21
RUN wget -O- https://download.java.net/openjdk/jdk21/ri/openjdk-21+35_linux-x64_bin.tar.gz | tar xz -C /opt/

# Set JAVA_HOME environment variable
ENV JAVA_HOME=/opt/jdk-21
ENV PATH=$JAVA_HOME/bin:$PATH

# Install Gradle 8.10
ENV GRADLE_VERSION=8.10

RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp \
&& unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip \
&& rm /tmp/gradle-${GRADLE_VERSION}-bin.zip

# Set GRADLE_HOME environment variable
ENV GRADLE_HOME=/opt/gradle/gradle-${GRADLE_VERSION}
ENV PATH=$GRADLE_HOME/bin:$PATH

# Clean up APT when done
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

0 comments on commit cc5ddde

Please sign in to comment.