Skip to content

Commit

Permalink
Update dev container to use system JDK 17 (#3070)
Browse files Browse the repository at this point in the history
Fixes #3068
  • Loading branch information
externl authored Nov 5, 2024
1 parent f683fe0 commit 71b18ed
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,10 @@ RUN set -eux \
&& sudo apt update \
&& sudo apt-get install -y php-dev python3 python3-dev python3-passlib ruby-full gdb \
&& sudo apt-get install -y libbluetooth-dev libbz2-dev libdbus-1-dev libedit-dev libexpat1-dev liblmdb-dev libmcpp-dev libssl-dev libsystemd-dev \
&& sudo apt-get install -y openjdk-17-jdk \
&& sudo rm -rf /var/lib/apt/lists/* \
&& sudo apt-get clean

# Borrowed from https://github.com/oracle/docker-images/blob/main/OracleJava/17/Dockerfile
ARG JAVA_URL=https://download.oracle.com/java/17/latest
ARG JAVA_HOME=/usr/java/jdk-17

RUN set -eux; \
ARCH="$(uname -m)" && \
# Java uses just x64 in the name of the tarball
if [ "$ARCH" = "x86_64" ]; \
then ARCH="x64"; \
fi && \
JAVA_PKG="$JAVA_URL"/jdk-17_linux-"${ARCH}"_bin.tar.gz ; \
JAVA_SHA256="$(curl "$JAVA_PKG".sha256)" ; \
curl --output /tmp/jdk.tgz "$JAVA_PKG" && \
echo "$JAVA_SHA256" */tmp/jdk.tgz | sha256sum -c; \
sudo mkdir -p "$JAVA_HOME"; \
sudo tar --extract --file /tmp/jdk.tgz --directory "$JAVA_HOME" --strip-components 1; \
rm /tmp/jdk.tgz;

# Install .NET 8.0
RUN set -eux \
&& curl https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh -L \
Expand All @@ -41,5 +24,3 @@ RUN set -eux \
ENV DOTNET_ROOT=/home/vscode/.dotnet
ENV PATH=$DOTNET_ROOT:$PATH
ENV LANG=en_US.UTF-8
ENV JAVA_HOME=/usr/java/jdk-17
ENV PATH=$JAVA_HOME/bin:$PATH

0 comments on commit 71b18ed

Please sign in to comment.