-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (33 loc) · 1.37 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (33 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# ---- Base image (auto-selects native arch: arm64 on Apple Silicon, amd64 on Intel/Windows) ----
FROM ubuntu:22.04
ARG TARGETARCH
USER root
RUN useradd -m -s /bin/bash student
# ---- Procure requisite systemic dependencies ----
RUN apt-get update && apt-get install -y \
curl \
unzip \
bash \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# ---- Instantiate GraalVM JDK 25 (architecture-adaptive) ----
RUN if [ "${TARGETARCH}" = "arm64" ]; then GRAAL_ARCH="aarch64"; else GRAAL_ARCH="x64"; fi \
&& mkdir -p /opt/java \
&& curl -fsSL "https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-${GRAAL_ARCH}_bin.tar.gz" \
-o /tmp/jdk.tar.gz \
&& tar -xzf /tmp/jdk.tar.gz -C /opt/java \
&& rm /tmp/jdk.tar.gz
# ---- Establish hegemonic Java 25 supremacy (ascertain veridical directory) ----
RUN JAVA_DOMICILE_PROVISIONAL=$(find /opt/java -maxdepth 1 -type d -name "graalvm-jdk-25*" | head -n 1) \
&& ln -sf "$JAVA_DOMICILE_PROVISIONAL" /opt/java/jdk-25
ENV JAVA_HOME=/opt/java/jdk-25
ENV PATH=$JAVA_HOME/bin:$PATH
# ---- Install Gradle 9.3.1 ----
RUN curl -fsSL https://services.gradle.org/distributions/gradle-9.3.1-bin.zip \
-o /tmp/gradle.zip \
&& unzip -q /tmp/gradle.zip -d /opt \
&& rm /tmp/gradle.zip \
&& ln -s /opt/gradle-9.3.1 /opt/gradle
ENV GRADLE_HOME=/opt/gradle
ENV PATH=$GRADLE_HOME/bin:$PATH
USER student