forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
FROM gitpod/workspace-full | ||
FROM gitpod/workspace-base | ||
|
||
USER gitpod | ||
# for illustration ourposes, this Dockerfile does not inherit from workspace-full but manually sets up Java and Gradle | ||
|
||
RUN bash -c ". /home/gitpod/.sdkman/bin/sdkman-init.sh && sdk install java 21.0.4.fx-zulu && sdk default java 21.0.4.fx-zulu" | ||
USER root | ||
|
||
# Install Java 21 (openjdk-21-jdk) | ||
RUN wget -O- https://apt.corretto.aws/corretto.key | gpg --dearmor | tee /usr/share/keyrings/amazon-corretto-archive-keyring.gpg > /dev/null && \ | ||
echo 'deb [signed-by=/usr/share/keyrings/amazon-corretto-archive-keyring.gpg] https://apt.corretto.aws stable main' | tee /etc/apt/sources.list.d/corretto.list && \ | ||
apt-get update && \ | ||
apt-get install -y java-21-amazon-corretto-jdk && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* | ||
|
||
# Install Gradle | ||
ARG GRADLE_VERSION=8.3 | ||
RUN wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -P /tmp && \ | ||
unzip -d /opt/gradle /tmp/gradle-${GRADLE_VERSION}-bin.zip && \ | ||
ln -s /opt/gradle/gradle-${GRADLE_VERSION}/bin/gradle /usr/bin/gradle | ||
|
||
# Ensure that Gradle saves all files in /workspace, because files outside that folder are not being backed up when a prebuild finishes or a workspace stops. | ||
ENV GRADLE_USER_HOME=/workspace/.gradle/ | ||
|
||
USER gitpod |