diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index c7d6bb59..4cee163b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,38 +1,48 @@ -# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/java/.devcontainer/base.Dockerfile - -# [Choice] Java version: 11, 15 -ARG VARIANT="15" -FROM mcr.microsoft.com/vscode/devcontainers/java:0-${VARIANT} - -# [Option] Install Maven -ARG INSTALL_MAVEN="false" -ARG MAVEN_VERSION="" -# [Option] Install Gradle -ARG INSTALL_GRADLE="false" -ARG GRADLE_VERSION="" -RUN if [ "${INSTALL_MAVEN}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install maven \"${MAVEN_VERSION}\""; fi \ - && if [ "${INSTALL_GRADLE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/sdkman/bin/sdkman-init.sh && sdk install gradle \"${GRADLE_VERSION}\""; fi - -# [Option] Install Node.js -ARG INSTALL_NODE="true" -ARG NODE_VERSION="lts/*" -RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi - -COPY --from=openjdk:8-jdk-buster /usr/local/openjdk-8 /usr/local/openjdk-8 -COPY --from=openjdk:11-jdk-buster /usr/local/openjdk-11 /usr/local/openjdk-11 -COPY --from=openjdk:17-jdk-buster /usr/local/openjdk-17 /usr/local/openjdk-17 - -ENV JAVA_HOME="/usr/local/openjdk-17" +FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 + +# Avoid prompts from apt +ENV DEBIAN_FRONTEND=noninteractive + +# Install cross-compilers and scientific libraries +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + build-essential \ + gcc-aarch64-linux-gnu libc6-dev-arm64-cross \ + gcc-riscv64-linux-gnu libc6-dev-riscv64-cross \ + gcc-x86-64-linux-gnu libc6-dev-amd64-cross \ + libopenblas-dev \ + liblapack-dev \ + libarpack2-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install multiple Java versions from Adoptium (Eclipse Temurin) +RUN bash -eux -o pipefail <" 2>&1 +ENV MAVEN_HOME=/opt/apache-maven-${MAVEN_VERSION} +ENV PATH="${MAVEN_HOME}/bin:${PATH}" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4bbe3922..1ff2dd9f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,45 +1,44 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/java { - "name": "Java", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a Java version: 11, 15 - "VARIANT": "11", - // Options - "INSTALL_MAVEN": "true", - "INSTALL_GRADLE": "false", - "INSTALL_NODE": "false", - "NODE_VERSION": "lts/*" - } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "java.home": "/docker-java-home" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "vscjava.vscode-java-pack" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "java -version", - - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - - "mounts": [ - "src=m2,dst=/home/vscode/.m2", - ], - - "runArgs": [ - "--privileged", - ], + "name": "Java Multi-Version Development", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "vscjava.vscode-maven", + "Anthropic.claude-code", + "GitHub.vscode-pull-request-github" + ], + "settings": { + "java.configuration.runtimes": [ + { + "name": "JavaSE-1.8", + "path": "/usr/lib/jvm/temurin-8-jdk-${localEnv:HOSTTYPE}" + }, + { + "name": "JavaSE-11", + "path": "/usr/lib/jvm/temurin-11-jdk-${localEnv:HOSTTYPE}" + }, + { + "name": "JavaSE-17", + "path": "/usr/lib/jvm/temurin-17-jdk-${localEnv:HOSTTYPE}" + }, + { + "name": "JavaSE-21", + "path": "/usr/lib/jvm/temurin-21-jdk-${localEnv:HOSTTYPE}" + }, + { + "name": "JavaSE-25", + "path": "/usr/lib/jvm/temurin-25-jdk-${localEnv:HOSTTYPE}", + "default": true + } + ] + } + } + }, + "forwardPorts": [], + "postCreateCommand": "java -version && mvn -version", + "remoteUser": "root" }