diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 1c7f0689c0..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,67 +0,0 @@ -# Update the VARIANT arg in devcontainer.json to pick a Java version >= 17 -ARG VARIANT=17 -FROM openjdk:${VARIANT}-jdk-buster - -# Options for setup script -ARG INSTALL_ZSH="true" -ARG UPGRADE_PACKAGES="false" -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID - -# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. -COPY library-scripts/*.sh /tmp/library-scripts/ -RUN apt-get update \ - && /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ - && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts - -# [Optional] Install Maven -ARG INSTALL_MAVEN="false" -ARG MAVEN_VERSION=3.6.3 -ARG MAVEN_DOWNLOAD_SHA="dev-mode" -ENV MAVEN_HOME /usr/share/maven \ - MAVEN_CONFIG /root/.m2 -COPY maven-settings.xml /usr/share/maven/ref/ -RUN if [ "${INSTALL_MAVEN}" = "true" ]; then \ - mkdir -p /usr/share/maven /usr/share/maven/ref \ - && curl -fsSL -o /tmp/apache-maven.tar.gz https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz \ - && ([ "${MAVEN_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${MAVEN_DOWNLOAD_SHA} */tmp/apache-maven.tar.gz" | sha512sum -c - ) \ - && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \ - && rm -f /tmp/apache-maven.tar.gz \ - && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn; \ - fi - -# [Optional] Install Gradle -ARG INSTALL_GRADLE="false" -ARG GRADLE_VERSION=5.4.1 -ARG GRADLE_DOWNLOAD_SHA="dev-mode" -ENV GRADLE_HOME=/opt/gradle -RUN if [ "${INSTALL_GRADLE}" = "true" ]; then \ - curl -sSL --output gradle.zip "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip" \ - && ([ "${GRADLE_DOWNLOAD_SHA}" = "dev-mode" ] || echo "${GRADLE_DOWNLOAD_SHA} *gradle.zip" | sha256sum --check - ) \ - && unzip gradle.zip \ - && rm gradle.zip \ - && mv "gradle-${GRADLE_VERSION}" "${GRADLE_HOME}/" \ - && ln -s "${GRADLE_HOME}/bin/gradle" /usr/bin/gradle; \ - fi - -# Allow for a consistant java home location for settings - image is changing over time -RUN if [ ! -d "/docker-java-home" ]; then ln -s "${JAVA_HOME}" /docker-java-home; fi - -# [Optional] Install Node.js for use with web applications - update the INSTALL_NODE arg in devcontainer.json to enable. -ARG INSTALL_NODE="false" -ARG NODE_VERSION="lts/*" -ENV NVM_DIR=/usr/local/share/nvm \ - NVM_SYMLINK_CURRENT=true \ - PATH=${NVM_DIR}/current/bin:${PATH} -COPY library-scripts/node-debian.sh /tmp/library-scripts/ -RUN if [ "$INSTALL_NODE" = "true" ]; then \ - /bin/bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \ - fi \ - && rm -rf /tmp/library-scripts - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update \ -# && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d2411fa995..2e84b84dc2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,39 +1,28 @@ { "name": "Java", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update the VARIANT arg to pick a Java version >= 17 - "VARIANT": "17", - // Options to install Maven or Gradle - "INSTALL_MAVEN": "true", - "MAVEN_VERSION": "3.6.3", - "MAVEN_DOWNLOAD_SHA": "c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0", - "INSTALL_GRADLE": "true", - "GRADLE_VERSION": "5.4.1", - "GRADLE_DOWNLOAD_SHA": "7bdbad1e4f54f13c8a78abc00c26d44dd8709d4aedb704d913fb1bb78ac025dc", - "INSTALL_NODE": "false", - "NODE_VERSION": "lts/*" - } - }, - + "image": "mcr.microsoft.com/devcontainers/java:17-bookworm", // Set *default* container specific settings.json values on container create. - "settings": { + "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" - ] - + ], + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "none", + "installGradle": "true", + "installMaven": "true" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "latest" + } + } // 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", - // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode" -} +} \ No newline at end of file diff --git a/.devcontainer/library-scripts/README.md b/.devcontainer/library-scripts/README.md deleted file mode 100644 index d06dfd1a95..0000000000 --- a/.devcontainer/library-scripts/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Warning: Folder contents may be replaced - -The contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged. - -To retain your edits, move the file to a different location. You may also delete the files if they are not needed. \ No newline at end of file diff --git a/.devcontainer/library-scripts/common-debian.sh b/.devcontainer/library-scripts/common-debian.sh deleted file mode 100755 index ffef7ba2d4..0000000000 --- a/.devcontainer/library-scripts/common-debian.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -# Syntax: ./common-debian.sh - -set -e - -INSTALL_ZSH=${1:-"true"} -USERNAME=${2:-"$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)"} -USER_UID=${3:-1000} -USER_GID=${4:-1000} -UPGRADE_PACKAGES=${5:-"true"} - -if [ "$(id -u)" -ne 0 ]; then - echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' - exit 1 -fi - -# Treat a user name of "none" as root -if [ "${USERNAME}" = "none" ] || [ "${USERNAME}" = "root" ]; then - USERNAME=root - USER_UID=0 - USER_GID=0 -fi - -# Ensure apt is in non-interactive to avoid prompts -export DEBIAN_FRONTEND=noninteractive - -# Install apt-utils to avoid debconf warning -apt-get -y install --no-install-recommends apt-utils 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 ) - -# Get to latest versions of all packages -if [ "${UPGRADE_PACKAGES}" = "true" ]; then - apt-get -y upgrade --no-install-recommends -fi - -# Install common developer tools and dependencies -apt-get -y install --no-install-recommends \ - git \ - openssh-client \ - less \ - iproute2 \ - procps \ - curl \ - wget \ - unzip \ - nano \ - jq \ - lsb-release \ - ca-certificates \ - apt-transport-https \ - dialog \ - gnupg2 \ - libc6 \ - libgcc1 \ - libgssapi-krb5-2 \ - libicu[0-9][0-9] \ - liblttng-ust0 \ - libstdc++6 \ - zlib1g \ - locales - -# Ensure at least the en_US.UTF-8 UTF-8 locale is available. -# Common need for both applications and things like the agnoster ZSH theme. -echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen -locale-gen - -# Install libssl1.1 if available -if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then - apt-get -y install --no-install-recommends libssl1.1 -fi - -# Install appropriate version of libssl1.0.x if available -LIBSSL=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '') -if [ "$(echo "$LIBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then - if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then - # Debian 9 - apt-get -y install --no-install-recommends libssl1.0.2 - elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then - # Ubuntu 18.04, 16.04, earlier - apt-get -y install --no-install-recommends libssl1.0.0 - fi -fi - -# Create or update a non-root user to match UID/GID - see https://aka.ms/vscode-remote/containers/non-root-user. -if id -u $USERNAME > /dev/null 2>&1; then - # User exists, update if needed - if [ "$USER_GID" != "$(id -G $USERNAME)" ]; then - groupmod --gid $USER_GID $USERNAME - usermod --gid $USER_GID $USERNAME - fi - if [ "$USER_UID" != "$(id -u $USERNAME)" ]; then - usermod --uid $USER_UID $USERNAME - fi -else - # Create user - groupadd --gid $USER_GID $USERNAME - useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME -fi - -# Add add sudo support for non-root user -apt-get install -y sudo -echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME -chmod 0440 /etc/sudoers.d/$USERNAME - -# Ensure ~/.local/bin is in the PATH for root and non-root users for bash. (zsh is later) -echo "export PATH=\$PATH:\$HOME/.local/bin" | tee -a /root/.bashrc >> /home/$USERNAME/.bashrc -chown $USER_UID:$USER_GID /home/$USERNAME/.bashrc - -# Optionally install and configure zsh -if [ "$INSTALL_ZSH" = "true" ] && [ ! -d "/root/.oh-my-zsh" ]; then - apt-get install -y zsh - sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" - echo "export PATH=\$PATH:\$HOME/.local/bin" >> /root/.zshrc - cp -R /root/.oh-my-zsh /home/$USERNAME - cp /root/.zshrc /home/$USERNAME - sed -i -e "s/\/root\/.oh-my-zsh/\/home\/$USERNAME\/.oh-my-zsh/g" /home/$USERNAME/.zshrc - chown -R $USER_UID:$USER_GID /home/$USERNAME/.oh-my-zsh /home/$USERNAME/.zshrc -fi - diff --git a/.devcontainer/library-scripts/node-debian.sh b/.devcontainer/library-scripts/node-debian.sh deleted file mode 100644 index 306fcd0120..0000000000 --- a/.devcontainer/library-scripts/node-debian.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- - -# Syntax: ./node-debian.sh - -set -e - -export NVM_DIR=${1:-"/usr/local/share/nvm"} -export NODE_VERSION=${2:-"lts/*"} -NONROOT_USER=${3:-"vscode"} - -if [ "$(id -u)" -ne 0 ]; then - echo 'Script must be run a root. Use sudo or set "USER root" before running the script.' - exit 1 -fi - -# Ensure apt is in non-interactive to avoid prompts -export DEBIAN_FRONTEND=noninteractive - -if [ "${NODE_VERSION}" = "none" ]; then - export NODE_VERSION= -fi - -# Install NVM -mkdir -p ${NVM_DIR} -curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash 2>&1 -if [ "${NODE_VERSION}" != "" ]; then - /bin/bash -c "source $NVM_DIR/nvm.sh && nvm alias default ${NODE_VERSION}" 2>&1 -fi - -echo -e "export NVM_DIR=\"${NVM_DIR}\"\n\ -[ -s \"\$NVM_DIR/nvm.sh\" ] && \\. \"\$NVM_DIR/nvm.sh\"\n\ -[ -s \"\$NVM_DIR/bash_completion\" ] && \\. \"\$NVM_DIR/bash_completion\"" \ -| tee -a /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc >> /root/.zshrc - -echo -e "if [ \"\$(stat -c '%U' \$NVM_DIR)\" != \"${NONROOT_USER}\" ]; then\n\ - sudo chown -R ${NONROOT_USER}:root \$NVM_DIR\n\ -fi" | tee -a /root/.bashrc /root/.zshrc /home/${NONROOT_USER}/.bashrc >> /home/${NONROOT_USER}/.zshrc - -chown ${NONROOT_USER}:${NONROOT_USER} /home/${NONROOT_USER}/.bashrc /home/${NONROOT_USER}/.zshrc -chown -R ${NONROOT_USER}:root ${NVM_DIR} - -# Install yarn -curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - 2>/dev/null -echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get -y install --no-install-recommends yarn diff --git a/.devcontainer/maven-settings.xml b/.devcontainer/maven-settings.xml deleted file mode 100644 index 50439abb02..0000000000 --- a/.devcontainer/maven-settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - /usr/share/maven/ref/repository - \ No newline at end of file