Skip to content

Commit

Permalink
Update Dockerfile to use environment variables for Maven and GraalVM …
Browse files Browse the repository at this point in the history
…versions
  • Loading branch information
Surya-KN committed Dec 30, 2023
1 parent 698e035 commit 97bcb20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Docker/dev/commons/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ RUN apt-get install gcc build-essential -y && \
libgl-dev libglib2.0-dev libgtk-3-dev libpango1.0-dev libx11-dev libxtst-dev zlib1g-dev -y --no-install-recommends &&\
apt-get clean && rm -rf /var/lib/apt/lists/*

# Download and install Maven 3.8.8 GraalVM
RUN wget https://apache.osuosl.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz && \
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.1/graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz && \
tar -xzf apache-maven-3.8.8-bin.tar.gz && \
tar -xzf graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz &&\
rm apache-maven-3.8.8-bin.tar.gz && \
rm graalvm-community-jdk-21.0.1_linux-x64_bin.tar.gz
RUN wget https://apache.osuosl.org/maven/maven-${MAVEN_MAJOR}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAAL_VERSION}/graalvm-community-jdk-${GRAAL_VERSION}_linux-x64_bin.tar.gz && \
tar -xzf apache-maven*.tar.gz -C /opt && \
tar -xzf graalvm-community-jdk*.tar.gz -C /opt &&\
ln -s /opt/apache-maven* /opt/maven &&\
ln -s /opt/graalvm-community* /opt/graalvm &&\
rm apache-maven*.tar.gz && \
rm graalvm-community-jdk*.tar.gz

# Setting environment variables
ENV PATH="/build/apache-maven-3.8.8/bin:$PATH"
ENV JAVA_HOME="/build/graalvm-community-openjdk-21.0.1+12.1"
ENV GRAALVM_HOME="/build/graalvm-community-openjdk-21.0.1+12.1"
ENV PATH="/build/graalvm-community-openjdk-21.0.1+12.1/bin:$PATH"
ENV PATH="/opt/maven/bin:$PATH"
ENV GRAALVM_HOME="/opt/graalvm"
ENV JAVA_HOME="/opt/graalvm"
ENV PATH="/opt/graalvm/bin:$PATH"
4 changes: 4 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ services:
build:
context: .
dockerfile: ./Docker/dev/commons/runner/Dockerfile
environment:
- GRAAL_VERSION=21.0.1
- MAVEN_MAJOR=3
- MAVEN_VERSION=3.8.8
container_name: drifty-runner

cli:
Expand Down

0 comments on commit 97bcb20

Please sign in to comment.