Skip to content

Commit

Permalink
Manually set up Dockerfile
Browse files Browse the repository at this point in the history
meysholdt committed Sep 27, 2024
1 parent c964fb5 commit c761067
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .gitpod.Dockerfile
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

0 comments on commit c761067

Please sign in to comment.