Skip to content

Instantly share code, notes, and snippets.

@selcukkubur
Created July 24, 2020 08:12
Show Gist options
  • Save selcukkubur/6249ad863c62eff27209732bacb5e085 to your computer and use it in GitHub Desktop.
Save selcukkubur/6249ad863c62eff27209732bacb5e085 to your computer and use it in GitHub Desktop.
Teamcity Linux Agent with Java 8 - 9 - 11
FROM jetbrains/teamcity-agent:2020.1-linux
USER 0
RUN mkdir -p /opt/build/tmp && \
mkdir -p /usr/local/jdk-8 && \
curl -Lo /opt/build/tmp/jdk-8u252-ojdkbuild-linux-x64.zip "https://github.com/ojdkbuild/contrib_jdk8u-ci/releases/download/jdk8u252-b09/jdk-8u252-ojdkbuild-linux-x64.zip" && \
unzip /opt/build/tmp/jdk-8u252-ojdkbuild-linux-x64.zip -d /usr/local/jdk-8 && \
mkdir -p /usr/local/jdk-9 && \
curl -o /opt/build/tmp/openjdk-9.0.4_linux-x64_bin.tar.gz "https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz" && \
tar zxvf /opt/build/tmp/openjdk-9.0.4_linux-x64_bin.tar.gz -C /usr/local/jdk-9 && \
mkdir -p /usr/local/jdk-11 && \
curl -o /opt/build/tmp/openjdk-11_linux-x64_bin.tar.gz "https://download.java.net/java/ga/jdk11/openjdk-11_linux-x64_bin.tar.gz" && \
tar zxvf /opt/build/tmp/openjdk-11_linux-x64_bin.tar.gz -C /usr/local/jdk-11 && \
rm -r /opt/build/tmp
ENV JAVA_HOME /usr/local/jdk-11/bin/java
USER 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment