From c12a205ab8e195541acfe0cb654b4888e16ea05c Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Fri, 3 Jun 2022 10:46:25 -0400 Subject: Pass options via environment variables (#39) * up to docker-in-docker converted * first pass at the rest of the features (and bash linting and updated CLI * move shell linter to own file * rename feature.json -> devcontainer-feature.json * continue on error * continue on error in right spot * formatting * fix AZ_VERSION * update python * restore variable name * update linter actions, fix dind/dfd/desktop scripts, add test-scenaerios * add tree because I like tree * glob for shell linter * fix test-scenarios * shell linter * more shell helper --- src/anaconda/devcontainer-feature.json | 22 +++++++ src/anaconda/feature.json | 22 ------- src/anaconda/install.sh | 11 ++-- src/aws-cli/devcontainer-feature.json | 21 +++++++ src/aws-cli/feature.json | 21 ------- src/aws-cli/install.sh | 9 ++- src/azure-cli/devcontainer-feature.json | 17 +++++ src/azure-cli/feature.json | 17 ----- src/azure-cli/install.sh | 5 +- src/common/devcontainer-feature.json | 63 +++++++++++++++++++ src/common/feature.json | 52 --------------- src/common/install.sh | 22 +++---- src/desktop-lite/devcontainer-feature.json | 57 +++++++++++++++++ src/desktop-lite/feature.json | 39 ------------ src/desktop-lite/install.sh | 18 +++--- src/docker-from-docker/devcontainer-feature.json | 48 ++++++++++++++ src/docker-from-docker/feature.json | 41 ------------ src/docker-from-docker/install.sh | 22 +++---- src/docker-in-docker/devcontainer-feature.json | 49 +++++++++++++++ src/docker-in-docker/feature.json | 42 ------------- src/docker-in-docker/install.sh | 17 ++--- src/dotnet/devcontainer-feature.json | 43 +++++++++++++ src/dotnet/feature.json | 38 ----------- src/dotnet/install.sh | 21 +++---- src/git-lfs/devcontainer-feature.json | 19 ++++++ src/git-lfs/feature.json | 16 ----- src/git-lfs/install.sh | 5 +- src/git/devcontainer-feature.json | 21 +++++++ src/git/feature.json | 21 ------- src/git/install.sh | 6 +- src/github-cli/devcontainer-feature.json | 19 ++++++ src/github-cli/feature.json | 16 ----- src/github-cli/install.sh | 4 +- src/go/devcontainer-feature.json | 24 +++++++ src/go/feature.json | 24 ------- src/go/install.sh | 17 +++-- src/hugo/devcontainer-feature.json | 22 +++++++ src/hugo/feature.json | 22 ------- src/hugo/install.sh | 11 ++-- src/java/devcontainer-feature.json | 34 ++++++++++ src/java/feature.json | 34 ---------- src/java/install.sh | 11 ++-- src/java/wrapper.sh | 2 +- src/jupyterlab/devcontainer-feature.json | 33 ++++++++++ src/jupyterlab/feature.json | 27 -------- src/jupyterlab/install.sh | 13 ++-- .../devcontainer-feature.json | 48 ++++++++++++++ src/kubectl-helm-minikube/feature.json | 38 ----------- src/kubectl-helm-minikube/install.sh | 19 +++--- src/node/devcontainer-feature.json | 41 ++++++++++++ src/node/feature.json | 32 ---------- src/node/install.sh | 16 ++--- src/oryx/devcontainer-feature.json | 14 +++++ src/oryx/feature.json | 14 ----- src/oryx/install.sh | 8 +-- src/php/devcontainer-feature.json | 39 ++++++++++++ src/php/feature.json | 36 ----------- src/php/install.sh | 20 +++--- src/powershell/devcontainer-feature.json | 20 ++++++ src/powershell/feature.json | 16 ----- src/powershell/install.sh | 5 +- src/python/devcontainer-feature.json | 68 ++++++++++++++++++++ src/python/feature.json | 73 ---------------------- src/python/install.sh | 28 ++++----- src/ruby/devcontainer-feature.json | 25 ++++++++ src/ruby/feature.json | 25 -------- src/ruby/install.sh | 13 ++-- src/rust/devcontainer-feature.json | 57 +++++++++++++++++ src/rust/feature.json | 57 ----------------- src/rust/install.sh | 19 +++--- src/sshd/devcontainer-feature.json | 17 +++++ src/sshd/feature.json | 17 ----- src/sshd/install.sh | 14 ++--- src/terraform/devcontainer-feature.json | 49 +++++++++++++++ src/terraform/feature.json | 49 --------------- src/terraform/install.sh | 15 +++-- 76 files changed, 1036 insertions(+), 974 deletions(-) create mode 100644 src/anaconda/devcontainer-feature.json delete mode 100644 src/anaconda/feature.json create mode 100644 src/aws-cli/devcontainer-feature.json delete mode 100644 src/aws-cli/feature.json create mode 100644 src/azure-cli/devcontainer-feature.json delete mode 100644 src/azure-cli/feature.json create mode 100644 src/common/devcontainer-feature.json delete mode 100644 src/common/feature.json create mode 100644 src/desktop-lite/devcontainer-feature.json delete mode 100644 src/desktop-lite/feature.json create mode 100644 src/docker-from-docker/devcontainer-feature.json delete mode 100644 src/docker-from-docker/feature.json create mode 100644 src/docker-in-docker/devcontainer-feature.json delete mode 100644 src/docker-in-docker/feature.json create mode 100644 src/dotnet/devcontainer-feature.json delete mode 100644 src/dotnet/feature.json create mode 100644 src/git-lfs/devcontainer-feature.json delete mode 100644 src/git-lfs/feature.json create mode 100644 src/git/devcontainer-feature.json delete mode 100644 src/git/feature.json create mode 100644 src/github-cli/devcontainer-feature.json delete mode 100644 src/github-cli/feature.json create mode 100644 src/go/devcontainer-feature.json delete mode 100644 src/go/feature.json create mode 100644 src/hugo/devcontainer-feature.json delete mode 100644 src/hugo/feature.json create mode 100644 src/java/devcontainer-feature.json delete mode 100644 src/java/feature.json create mode 100644 src/jupyterlab/devcontainer-feature.json delete mode 100644 src/jupyterlab/feature.json create mode 100644 src/kubectl-helm-minikube/devcontainer-feature.json delete mode 100644 src/kubectl-helm-minikube/feature.json create mode 100644 src/node/devcontainer-feature.json delete mode 100644 src/node/feature.json create mode 100644 src/oryx/devcontainer-feature.json delete mode 100644 src/oryx/feature.json create mode 100644 src/php/devcontainer-feature.json delete mode 100644 src/php/feature.json create mode 100644 src/powershell/devcontainer-feature.json delete mode 100644 src/powershell/feature.json create mode 100644 src/python/devcontainer-feature.json delete mode 100644 src/python/feature.json create mode 100644 src/ruby/devcontainer-feature.json delete mode 100644 src/ruby/feature.json create mode 100644 src/rust/devcontainer-feature.json delete mode 100644 src/rust/feature.json create mode 100644 src/sshd/devcontainer-feature.json delete mode 100644 src/sshd/feature.json create mode 100644 src/terraform/devcontainer-feature.json delete mode 100644 src/terraform/feature.json (limited to 'src') diff --git a/src/anaconda/devcontainer-feature.json b/src/anaconda/devcontainer-feature.json new file mode 100644 index 0000000..f733b63 --- /dev/null +++ b/src/anaconda/devcontainer-feature.json @@ -0,0 +1,22 @@ +{ + "id": "anaconda", + "name": "Anaconda", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter an anaconda version." + } + }, + "containerEnv": { + "CONDA_DIR": "/usr/local/conda", + "PATH": "${CONDA_DIR}/bin:${PATH}" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/anaconda/feature.json b/src/anaconda/feature.json deleted file mode 100644 index f733b63..0000000 --- a/src/anaconda/feature.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "anaconda", - "name": "Anaconda", - "options": { - "version": { - "type": "string", - "proposals": [ - "latest" - ], - "default": "latest", - "description": "Select or enter an anaconda version." - } - }, - "containerEnv": { - "CONDA_DIR": "/usr/local/conda", - "PATH": "${CONDA_DIR}/bin:${PATH}" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/anaconda/install.sh b/src/anaconda/install.sh index f7dfd0b..272ba73 100644 --- a/src/anaconda/install.sh +++ b/src/anaconda/install.sh @@ -6,13 +6,12 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/anaconda.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./anaconda-debian.sh [Conda version] [Non-root user] [Add rc files flag] -VERSION=${1:-"latest"} -USERNAME=${2:-"automatic"} -UPDATE_RC=${3:-"true"} +VERSION=${VERSION:-"latest"} + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} CONDA_DIR=${CONDA_DIR:-"/usr/local/conda"} set -eux @@ -32,7 +31,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/aws-cli/devcontainer-feature.json b/src/aws-cli/devcontainer-feature.json new file mode 100644 index 0000000..ee1df10 --- /dev/null +++ b/src/aws-cli/devcontainer-feature.json @@ -0,0 +1,21 @@ +{ + "id": "aws-cli", + "name": "AWS CLI", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter an AWS CLI version. (Available versions here: https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst)" + } + }, + "extensions": [ + "AmazonWebServices.aws-toolkit-vscode" + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/aws-cli/feature.json b/src/aws-cli/feature.json deleted file mode 100644 index ee1df10..0000000 --- a/src/aws-cli/feature.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "aws-cli", - "name": "AWS CLI", - "options": { - "version": { - "type": "string", - "proposals": [ - "latest" - ], - "default": "latest", - "description": "Select or enter an AWS CLI version. (Available versions here: https://github.com/aws/aws-cli/blob/v2/CHANGELOG.rst)" - } - }, - "extensions": [ - "AmazonWebServices.aws-toolkit-vscode" - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/aws-cli/install.sh b/src/aws-cli/install.sh index 0d204de..b2566c9 100755 --- a/src/aws-cli/install.sh +++ b/src/aws-cli/install.sh @@ -6,12 +6,11 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/awscli.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./awscli-debian.sh [AWS CLI version] set -e -AWSCLI_VERSION=${1:-"latest"} +VERSION=${VERSION:-"latest"} + AWSCLI_GPG_KEY=FB5DB77FD5C118B80511ADA8A6310ACC4672475C AWSCLI_GPG_KEY_MATERIAL="-----BEGIN PGP PUBLIC KEY BLOCK----- @@ -108,8 +107,8 @@ install() { local scriptSigFile=awscli.sig # See Linux install docs at https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html - if [ "${AWSCLI_VERSION}" != "latest" ]; then - local versionStr=-${AWSCLI_VERSION} + if [ "${VERSION}" != "latest" ]; then + local versionStr=-${VERSION} fi architecture=$(dpkg --print-architecture) case "${architecture}" in diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json new file mode 100644 index 0000000..6ae3769 --- /dev/null +++ b/src/azure-cli/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "id": "azure-cli", + "name": "Azure CLI", + "options": { + "version": { + "type": "string", + "proposals": ["latest"], + "default": "latest", + "description": "Select or enter an Azure CLI version. (Available versions may vary by Linux distribution.)" + } + }, + "extensions": ["ms-vscode.azurecli"], + "install": { + "app": "", + "file": "install.sh" + } +} diff --git a/src/azure-cli/feature.json b/src/azure-cli/feature.json deleted file mode 100644 index 6ae3769..0000000 --- a/src/azure-cli/feature.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "azure-cli", - "name": "Azure CLI", - "options": { - "version": { - "type": "string", - "proposals": ["latest"], - "default": "latest", - "description": "Select or enter an Azure CLI version. (Available versions may vary by Linux distribution.)" - } - }, - "extensions": ["ms-vscode.azurecli"], - "install": { - "app": "", - "file": "install.sh" - } -} diff --git a/src/azure-cli/install.sh b/src/azure-cli/install.sh index a7f2a84..d5a586f 100644 --- a/src/azure-cli/install.sh +++ b/src/azure-cli/install.sh @@ -6,12 +6,11 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/azcli.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./azcli-debian.sh set -e -AZ_VERSION=${1:-"latest"} +AZ_VERSION=${VERSION:-"latest"} + MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" AZCLI_ARCHIVE_ARCHITECTURES="amd64" AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal" diff --git a/src/common/devcontainer-feature.json b/src/common/devcontainer-feature.json new file mode 100644 index 0000000..318d0cf --- /dev/null +++ b/src/common/devcontainer-feature.json @@ -0,0 +1,63 @@ +{ + "id": "common", + "name": "common", + "description": "common", + "options": { + "install_Zsh": { + "type": "boolean", + "default": true, + "description": "Install ZSH?" + }, + "install_Oh_My_Zsh": { + "type": "boolean", + "default": true, + "description": "Install Oh My Zsh!?" + }, + "upgrade_packages": { + "type": "boolean", + "default": true, + "description": "Upgrade OS packages?" + }, + "username": { + "type": "string", + "proposals": [ + "vscode", + "codespace", + "none", + "automatic" + ], + "default": "automatic", + "description": "Enter name of non-root user to configure or none to skip" + }, + "user_uid": { + "type": "string", + "proposals": [ + "1000", + "automatic" + ], + "default": "automatic", + "description": "Enter uid for non-root user" + }, + "user_gid": { + "type": "string", + "proposals": [ + "1000", + "automatic" + ], + "default": "automatic", + "description": "Enter gid for non-root user" + }, + "add_non_free_packages": { + "type": "boolean", + "default": false, + "description": "Add packages from non-free Debian repository?" + } + }, + "extensions": [ + "ms-dotnettools.csharp" + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/common/feature.json b/src/common/feature.json deleted file mode 100644 index d6b94f2..0000000 --- a/src/common/feature.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "id": "common", - "name": "common", - "description": "common", - "options": { - "installZsh": { - "type": "boolean", - "default": true, - "description": "Install ZSH?" - }, - "installOhMyZsh": { - "type": "boolean", - "default": true, - "description": "Install Oh My Zsh!?" - }, - "upgradePackages": { - "type":"boolean", - "default": true, - "description": "Upgrade OS packages?" - }, - "username": { - "type":"string", - "proposals": ["vscode", "codespace", "none", "automatic"], - "default": "automatic", - "description": "Enter name of non-root user to configure or none to skip" - }, - "uid": { - "type":"string", - "proposals": ["1000", "automatic"], - "default": "automatic", - "description": "Enter uid for non-root user" - }, - "gid": { - "type": "string", - "proposals": ["1000", "automatic"], - "default": "automatic", - "description": "Enter gid for non-root user" - }, - "nonFreePackages": { - "type":"boolean", - "default": true, - "description": "Add packages from non-free Debian repository?" - } - }, - "extensions": [ - "ms-dotnettools.csharp" - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/common/install.sh b/src/common/install.sh index 77c64db..ab8adb0 100644 --- a/src/common/install.sh +++ b/src/common/install.sh @@ -6,18 +6,17 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My Zsh! flag] [Add non-free packages] set -e -INSTALL_ZSH=${1:-"true"} -USERNAME=${2:-"automatic"} -USER_UID=${3:-"automatic"} -USER_GID=${4:-"automatic"} -UPGRADE_PACKAGES=${5:-"true"} -INSTALL_OH_MYS=${6:-"true"} -ADD_NON_FREE_PACKAGES=${7:-"false"} +INSTALL_ZSH=${INSTALL_ZSH:-"true"} +INSTALL_OH_MY_ZSH=${INSTALL_OH_MY_ZSH:-"true"} +UPGRADE_PACKAGES=${UPGRADE_PACKAGES:-"true"} +USERNAME=${USERNAME:-"automatic"} +USER_UID=${USER_UID:-"automatic"} +USER_GID=${USER_GID:-"automatic"} +ADD_NON_FREE_PACKAGES=${ADD_NON_FREE_PACKAGES:-"false"} + SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)" MARKER_FILE="/usr/local/etc/vscode-dev-containers/common" @@ -35,7 +34,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break @@ -85,6 +84,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then net-tools \ psmisc \ curl \ + tree \ wget \ rsync \ ca-certificates \ @@ -376,7 +376,7 @@ if [ "${INSTALL_ZSH}" = "true" ]; then # Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme. # See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script. oh_my_install_dir="${user_rc_path}/.oh-my-zsh" - if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then + if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MY_ZSH}" = "true" ]; then template_path="${oh_my_install_dir}/templates/zshrc.zsh-template" user_rc_file="${user_rc_path}/.zshrc" umask g-w,o-w diff --git a/src/desktop-lite/devcontainer-feature.json b/src/desktop-lite/devcontainer-feature.json new file mode 100644 index 0000000..fa7649c --- /dev/null +++ b/src/desktop-lite/devcontainer-feature.json @@ -0,0 +1,57 @@ +{ + "id": "desktop-lite", + "name": "Light-weight desktop (Fluxbox)", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Currently Unused!" + }, + "novnc_version": { + "type": "string", + "proposals": [ + "1.2.0" + ], + "default": "1.2.0", + "description": "NoVnc Version" + }, + "vnc_password": { + "type": "string", + "proposals": [ + "vscode", + "codespaces", + "password" + ], + "default": "vscode", + "description": "Enter a password for desktop connections" + }, + "novnc_port": { + "type": "string", + "proposals": [ + "6080" + ], + "default": "6080", + "description": "Enter a port for the VNC web client" + }, + "vnc_port": { + "type": "string", + "proposals": [ + "5901" + ], + "default": "5901", + "description": "Enter a port for the desktop VNC server" + } + }, + "init": true, + "entrypoint": "/usr/local/share/desktop-init.sh", + "containerEnv": { + "DISPLAY": ":1" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/desktop-lite/feature.json b/src/desktop-lite/feature.json deleted file mode 100644 index 4ad8b8d..0000000 --- a/src/desktop-lite/feature.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "desktop-lite", - "name": "Light-weight desktop (Fluxbox)", - "options": { - "version": { - "type": "string", - "enum": ["latest"], - "default": "latest", - "description": "Currently unused." - }, - "password": { - "type": "string", - "proposals": ["vscode","codespaces","password"], - "default": "vscode", - "description": "Enter a password for desktop connections" - }, - "webPort": { - "type": "string", - "proposals": ["6080"], - "default": "6080", - "description": "Enter a port for the desktop web client" - }, - "vncPort": { - "type": "string", - "proposals": ["5901"], - "default": "5901", - "description": "Enter a port for the desktop VNC server" - } - }, - "init": true, - "entrypoint": "/usr/local/share/desktop-init.sh", - "containerEnv": { - "DISPLAY": ":1" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/desktop-lite/install.sh b/src/desktop-lite/install.sh index ac149c4..e9f74f1 100644 --- a/src/desktop-lite/install.sh +++ b/src/desktop-lite/install.sh @@ -6,16 +6,16 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/desktop-lite.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./desktop-lite-debian.sh [non-root user] [Desktop password] [Install web client flag] [VNC port] [Web Port] -USERNAME=${1:-"automatic"} -VNC_PASSWORD=${2:-"vscode"} -INSTALL_NOVNC=${3:-"true"} -VNC_PORT="${4:-5901}" -NOVNC_PORT="${5:-6080}" +NOVNC_VERSION=${NOVNC_VERSION:-"1.2.0"} # TODO: Add in a 'latest' auto-detect and swap name to 'version' +VNC_PASSWORD=${VNC_PASSWORD:-"vscode"} +NOVNC_PORT="${NOVNC_PORT:-6080}" +VNC_PORT="${VNC_PORT:-5901}" + +INSTALL_NOVNC=${INSTALL_NOVNC:-"true"} +USERNAME=${USERNAME:-"automatic"} + -NOVNC_VERSION=1.2.0 WEBSOCKETIFY_VERSION=0.10.0 package_list=" @@ -72,7 +72,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/docker-from-docker/devcontainer-feature.json b/src/docker-from-docker/devcontainer-feature.json new file mode 100644 index 0000000..f9c5d28 --- /dev/null +++ b/src/docker-from-docker/devcontainer-feature.json @@ -0,0 +1,48 @@ +{ + "id": "docker-from-docker", + "name": "Docker (Moby) support, reuse host Docker Engine (Docker-from-Docker)", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "20.10" + ], + "default": "latest", + "description": "Select or enter a Docker/Moby CLI version. (Availability can vary by OS version.)" + }, + "moby": { + "type": "boolean", + "default": true, + "description": "Install OSS Moby build instead of Docker CE" + }, + "docker_dash_compose_version": { + "type": "string", + "enum": [ + "v1", + "v2" + ], + "default": "v1", + "description": "Compose version to use for docker-compose (v1 or v2)" + } + }, + "entrypoint": "/usr/local/share/docker-init.sh", + "containerEnv": { + "DOCKER_BUILDKIT": "1" + }, + "extensions": [ + "ms-azuretools.vscode-docker" + ], + "mounts": [ + { + "source": "/var/run/docker.sock", + "target": "/var/run/docker-host.sock", + "type": "bind" + } + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/docker-from-docker/feature.json b/src/docker-from-docker/feature.json deleted file mode 100644 index ce955a7..0000000 --- a/src/docker-from-docker/feature.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "id": "docker-from-docker", - "name": "Docker (Moby) support, reuse host Docker Engine (Docker-from-Docker)", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "20.10"], - "default": "latest", - "description": "Select or enter a Docker/Moby CLI version. (Availability can vary by OS version.)" - }, - "moby": { - "type": "boolean", - "default": true, - "description": "Install OSS Moby build instead of Docker CE" - }, - "dockerDashComposeVersion": { - "type": "string", - "enum": ["v1", "v2" ], - "default": "v1", - "description": "Compose version to use for docker-compose (v1 or v2)" - } - }, - "entrypoint": "/usr/local/share/docker-init.sh", - "containerEnv": { - "DOCKER_BUILDKIT": "1" - }, - "extensions": [ - "ms-azuretools.vscode-docker" - ], - "mounts": [ - { - "source":"/var/run/docker.sock", - "target":"/var/run/docker-host.sock", - "type":"bind" - } - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/docker-from-docker/install.sh b/src/docker-from-docker/install.sh index 1102ae9..88ad52f 100644 --- a/src/docker-from-docker/install.sh +++ b/src/docker-from-docker/install.sh @@ -6,16 +6,16 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./docker-debian.sh [enable non-root docker socket access flag] [source socket] [target socket] [non-root user] [use moby] [CLI version] [Major version for docker-compose] - -ENABLE_NONROOT_DOCKER=${1:-"true"} -SOURCE_SOCKET=${2:-"/var/run/docker-host.sock"} -TARGET_SOCKET=${3:-"/var/run/docker.sock"} -USERNAME=${4:-"automatic"} -USE_MOBY=${5:-"true"} -DOCKER_VERSION=${6:-"latest"} -DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 + +DOCKER_VERSION=${VERSION:-"latest"} +USE_MOBY=${MOBY:-"true"} +DOCKER_DASH_COMPOSE_VERSION=${DOCKER_DASH_COMPOSE_VERSION:-"v1"} # v1 or v2 + +ENABLE_NONROOT_DOCKER=${ENABLE_NONROOT_DOCKER:-"true"} +SOURCE_SOCKET=${SOURCE_SOCKET:-"/var/run/docker-host.sock"} +TARGET_SOCKET=${TARGET_SOCKET:-"/var/run/docker.sock"} +USERNAME=${USERNAME:-"automatic"} + MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal jammy" DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute impish jammy" @@ -31,7 +31,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/docker-in-docker/devcontainer-feature.json b/src/docker-in-docker/devcontainer-feature.json new file mode 100644 index 0000000..096756d --- /dev/null +++ b/src/docker-in-docker/devcontainer-feature.json @@ -0,0 +1,49 @@ +{ + "id": "docker-in-docker", + "name": "Docker (Moby) support (Docker-in-Docker)", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "20.10" + ], + "default": "latest", + "description": "Select or enter a Docker/Moby Engine version. (Availability can vary by OS version.)" + }, + "moby": { + "type": "boolean", + "default": true, + "description": "Install OSS Moby build instead of Docker CE" + }, + "docker_dash_compose_version": { + "type": "string", + "enum": [ + "v1", + "v2" + ], + "default": "v1", + "description": "Default version of Docker Compose (v1 or v2)" + } + }, + "entrypoint": "/usr/local/share/docker-init.sh", + "privileged": true, + "containerEnv": { + "DOCKER_BUILDKIT": "1" + }, + "extensions": [ + "ms-azuretools.vscode-docker" + ], + "mounts": [ + { + "source": "dind-var-lib-docker", + "target": "/var/lib/docker", + "type": "volume" + } + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/docker-in-docker/feature.json b/src/docker-in-docker/feature.json deleted file mode 100644 index 0aa95e9..0000000 --- a/src/docker-in-docker/feature.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "id": "docker-in-docker", - "name": "Docker (Moby) support (Docker-in-Docker)", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "20.10" ], - "default": "latest", - "description": "Select or enter a Docker/Moby Engine version. (Availability can vary by OS version.)" - }, - "moby": { - "type": "boolean", - "default": true, - "description": "Install OSS Moby build instead of Docker CE" - }, - "dockerDashComposeVersion": { - "type": "string", - "enum": ["v1", "v2" ], - "default": "v1", - "description": "Default version of Docker Compose (v1 or v2)" - } - }, - "entrypoint": "/usr/local/share/docker-init.sh", - "privileged": true, - "containerEnv": { - "DOCKER_BUILDKIT": "1" - }, - "extensions": [ - "ms-azuretools.vscode-docker" - ], - "mounts": [ - { - "source":"dind-var-lib-docker", - "target":"/var/lib/docker", - "type":"volume" - } - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/docker-in-docker/install.sh b/src/docker-in-docker/install.sh index a525203..02dd260 100644 --- a/src/docker-in-docker/install.sh +++ b/src/docker-in-docker/install.sh @@ -6,14 +6,15 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker-in-docker.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./docker-in-docker-debian.sh [enable non-root docker access flag] [non-root user] [use moby] [Engine/CLI Version] [Major version for docker-compose] -ENABLE_NONROOT_DOCKER=${1:-"true"} -USERNAME=${2:-"automatic"} -USE_MOBY=${3:-"true"} -DOCKER_VERSION=${4:-"latest"} # The Docker/Moby Engine + CLI should match in version -DOCKER_DASH_COMPOSE_VERSION=${5:-"v1"} # v1 or v2 + +DOCKER_VERSION=${VERSION:-"latest"} # The Docker/Moby Engine + CLI should match in version +USE_MOBY=${MOBY:-"true"} +DOCKER_DASH_COMPOSE_VERSION=${DOCKER_DASH_COMPOSE_VERSION:-"v1"} # v1 or v2 + +ENABLE_NONROOT_DOCKER=${ENABLE_NONROOT_DOCKER:-"true"} +USERNAME=${USERNAME:-"automatic"} + MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal jammy" DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute impish jammy" @@ -40,7 +41,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/dotnet/devcontainer-feature.json b/src/dotnet/devcontainer-feature.json new file mode 100644 index 0000000..04b2811 --- /dev/null +++ b/src/dotnet/devcontainer-feature.json @@ -0,0 +1,43 @@ +{ + "id": "dotnet", + "name": "Dotnet CLI", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "6.0", + "5.0", + "3.1" + ], + "default": "latest", + "description": "Select or enter a dotnet CLI version. (Available versions may vary by Linux distribution.)" + }, + "runtime_only": { + "type": "boolean", + "default": false, + "description": "Install just the dotnet runtime if true, and sdk if false." + }, + "override_default_version": { + "type": "boolean", + "default": "true", + "description": "If true, overrides existing version (if any) of dotnet on the PATH" + }, + "install_using_apt": { + "type": "boolean", + "default": "true", + "description": "If true, it installs using apt instead of the release URL" + } + }, + "containerEnv": { + "DOTNET_ROOT": "/usr/local/dotnet/current", + "PATH": "${PATH}:${DOTNET_ROOT}" + }, + "extensions": [ + "ms-dotnettools.csharp" + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/dotnet/feature.json b/src/dotnet/feature.json deleted file mode 100644 index 4e2c7a7..0000000 --- a/src/dotnet/feature.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "id": "dotnet", - "name": "Dotnet CLI", - "options": { - "version": { - "type": "string", - "proposals": ["latest","6.0","5.0","3.1"], - "default": "latest", - "description": "Select or enter a dotnet CLI version. (Available versions may vary by Linux distribution.)" - }, - "runtimeOnly": { - "type":"boolean", - "default": false, - "description": "Install just the dotnet runtime if true, and sdk if false." - }, - "overrideDefaultVersion": { - "type": "boolean", - "default": "true", - "description": "If true, overrides existing version (if any) of dotnet on the PATH" - }, - "installUsingApt": { - "type": "boolean", - "default": "true", - "description": "If true, it installs using apt instead of the release URL" - } - }, - "containerEnv": { - "DOTNET_ROOT": "/usr/local/dotnet/current", - "PATH": "${PATH}:${DOTNET_ROOT}" - }, - "extensions": [ - "ms-dotnettools.csharp" - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh index 4052dbd..0a147bc 100644 --- a/src/dotnet/install.sh +++ b/src/dotnet/install.sh @@ -6,17 +6,16 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/dotnet.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./dotnet-debian.sh [.NET version] [.NET runtime only] [non-root user] [add TARGET_DOTNET_ROOT to rc files flag] [.NET root] [access group name] - -DOTNET_VERSION=${1:-"latest"} -DOTNET_RUNTIME_ONLY=${2:-"false"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} -TARGET_DOTNET_ROOT=${5:-"/usr/local/dotnet"} -ACCESS_GROUP=${6:-"dotnet"} -OVERRIDE_DEFAULT_VERSION=${7:-"true"} -INSTALL_USING_APT=${8:-"true"} + +DOTNET_VERSION=${VERSION:-"latest"} +DOTNET_RUNTIME_ONLY=${RUNTIME_ONLY:-"false"} +OVERRIDE_DEFAULT_VERSION=${OVERRIDE_DEFAULT_VERSION:-"true"} +INSTALL_USING_APT=${INSTALL_USING_APT:-"true"} + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} +TARGET_DOTNET_ROOT=${TARGET_DOTNET_ROOT:-"/usr/local/dotnet"} +ACCESS_GROUP=${ACCESS_GROUP:-"dotnet"} MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" DOTNET_ARCHIVE_ARCHITECTURES="amd64" diff --git a/src/git-lfs/devcontainer-feature.json b/src/git-lfs/devcontainer-feature.json new file mode 100644 index 0000000..516454e --- /dev/null +++ b/src/git-lfs/devcontainer-feature.json @@ -0,0 +1,19 @@ +{ + "id": "git-lfs", + "name": "Git Large File Support (LFS)", + "options": { + "version": { + "type": "string", + "enum": [ + "latest", + "none" + ], + "default": "latest", + "description": "Select version of Git LFS to install" + } + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/git-lfs/feature.json b/src/git-lfs/feature.json deleted file mode 100644 index 892670b..0000000 --- a/src/git-lfs/feature.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "git-lfs", - "name": "Git Large File Support (LFS)", - "options": { - "version": { - "type": "string", - "enum": ["latest", "none"], - "default": "latest", - "description": "Currently unused." - } - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/git-lfs/install.sh b/src/git-lfs/install.sh index dd9e702..0ba88c3 100644 --- a/src/git-lfs/install.sh +++ b/src/git-lfs/install.sh @@ -6,10 +6,9 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/git-lfs.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./git-lfs-debian.sh [version] -GIT_LFS_VERSION=${1:-"latest"} +GIT_LFS_VERSION=${VERSION:-"latest"} + GIT_LFS_ARCHIVE_GPG_KEY_URI="https://packagecloud.io/github/git-lfs/gpgkey" GIT_LFS_ARCHIVE_ARCHITECTURES="amd64" GIT_LFS_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal" diff --git a/src/git/devcontainer-feature.json b/src/git/devcontainer-feature.json new file mode 100644 index 0000000..6d9686b --- /dev/null +++ b/src/git/devcontainer-feature.json @@ -0,0 +1,21 @@ +{ + "id": "git", + "name": "Git (may require compilation)", + "options": { + "version": { + "type": "string", + "proposals": ["latest", "os-provided"], + "default": "os-provided", + "description": "Select or enter a Git version." + }, + "ppa": { + "type": "boolean", + "default": true, + "description": "Install from PPA if available" + } + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/git/feature.json b/src/git/feature.json deleted file mode 100644 index 6d9686b..0000000 --- a/src/git/feature.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "git", - "name": "Git (may require compilation)", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "os-provided"], - "default": "os-provided", - "description": "Select or enter a Git version." - }, - "ppa": { - "type": "boolean", - "default": true, - "description": "Install from PPA if available" - } - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/git/install.sh b/src/git/install.sh index 6900897..1da6500 100644 --- a/src/git/install.sh +++ b/src/git/install.sh @@ -6,11 +6,9 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/git-from-src.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./git-from-src-debian.sh [version] [use PPA if available] -GIT_VERSION=${1:-"latest"} # 'system' checks the base image first, else installs 'latest' -USE_PPA_IF_AVAILABLE=${2:-"false"} +GIT_VERSION=${VERSION:-"latest"} # 'system' checks the base image first, else installs 'latest' +USE_PPA_IF_AVAILABLE=${PPA:-"false"} GIT_CORE_PPA_ARCHIVE_GPG_KEY=E1DD270288B4E6030699E45FA1715D88E1DF1F24 GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80 diff --git a/src/github-cli/devcontainer-feature.json b/src/github-cli/devcontainer-feature.json new file mode 100644 index 0000000..a99634c --- /dev/null +++ b/src/github-cli/devcontainer-feature.json @@ -0,0 +1,19 @@ +{ + "id": "github-cli", + "name": "GitHub CLI", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none" + ], + "default": "latest", + "description": "Select version of the GitHub CLI, if not latest." + } + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/github-cli/feature.json b/src/github-cli/feature.json deleted file mode 100644 index 9a00923..0000000 --- a/src/github-cli/feature.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "github-cli", - "name": "GitHub CLI", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none"], - "default": "latest", - "description": "Select version of the GitHub CLI, if not latest." - } - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/github-cli/install.sh b/src/github-cli/install.sh index 01ad4d4..4fea41b 100644 --- a/src/github-cli/install.sh +++ b/src/github-cli/install.sh @@ -6,10 +6,8 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/github.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./github-debian.sh [version] -CLI_VERSION=${1:-"latest"} +CLI_VERSION=${VERSION:-"latest"} GITHUB_CLI_ARCHIVE_GPG_KEY=C99B11DEB97541F0 GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80 diff --git a/src/go/devcontainer-feature.json b/src/go/devcontainer-feature.json new file mode 100644 index 0000000..387839e --- /dev/null +++ b/src/go/devcontainer-feature.json @@ -0,0 +1,24 @@ +{ + "id": "go", + "name": "Go", + "options": { + "version": { + "type": "string", + "proposals": ["latest", "none", "1.18", "1.17"], + "default": "latest", + "description": "Select or enter a Go version to install" + } + }, + "init": true, + "extensions": ["golang.Go"], + "containerEnv": { + "GOPATH": "/go", + "PATH": "${GOPATH}/bin:${GOROOT}/bin:${PATH}" + }, + "capAdd": [ "SYS_PTRACE" ], + "securityOpt": [ "seccomp=unconfined" ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/go/feature.json b/src/go/feature.json deleted file mode 100644 index 387839e..0000000 --- a/src/go/feature.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "go", - "name": "Go", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "1.18", "1.17"], - "default": "latest", - "description": "Select or enter a Go version to install" - } - }, - "init": true, - "extensions": ["golang.Go"], - "containerEnv": { - "GOPATH": "/go", - "PATH": "${GOPATH}/bin:${GOROOT}/bin:${PATH}" - }, - "capAdd": [ "SYS_PTRACE" ], - "securityOpt": [ "seccomp=unconfined" ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/go/install.sh b/src/go/install.sh index 86d652b..96a1b38 100644 --- a/src/go/install.sh +++ b/src/go/install.sh @@ -6,15 +6,14 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/go.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./go-debian.sh [Go version] [GOROOT] [GOPATH] [non-root user] [Add GOPATH, GOROOT to rc files flag] [Install tools flag] -TARGET_GO_VERSION=${1:-"latest"} -TARGET_GOROOT=${2:-"/usr/local/go"} -TARGET_GOPATH=${3:-"/go"} -USERNAME=${4:-"automatic"} -UPDATE_RC=${5:-"true"} -INSTALL_GO_TOOLS=${6:-"true"} +TARGET_GO_VERSION=${VERSION:-"latest"} + +TARGET_GOROOT=${TARGET_GOROOT:-"/usr/local/go"} +TARGET_GOPATH=${TARGET_GOPATH:-"/go"} +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} +INSTALL_GO_TOOLS=${INSTALL_GO_TOOLS:-"true"} # https://www.google.com/linuxrepositories/ GO_GPG_KEY_URI="https://dl.google.com/linux/linux_signing_key.pub" @@ -35,7 +34,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/hugo/devcontainer-feature.json b/src/hugo/devcontainer-feature.json new file mode 100644 index 0000000..1d06486 --- /dev/null +++ b/src/hugo/devcontainer-feature.json @@ -0,0 +1,22 @@ +{ + "id": "hugo", + "name": "Hugo", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter a version." + } + }, + "containerEnv": { + "HUGO_DIR": "/usr/local/hugo", + "PATH": "${HUGO_DIR}/bin:${PATH}" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/hugo/feature.json b/src/hugo/feature.json deleted file mode 100644 index 1d06486..0000000 --- a/src/hugo/feature.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "hugo", - "name": "Hugo", - "options": { - "version": { - "type": "string", - "proposals": [ - "latest" - ], - "default": "latest", - "description": "Select or enter a version." - } - }, - "containerEnv": { - "HUGO_DIR": "/usr/local/hugo", - "PATH": "${HUGO_DIR}/bin:${PATH}" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/hugo/install.sh b/src/hugo/install.sh index de1d03c..9e25aeb 100644 --- a/src/hugo/install.sh +++ b/src/hugo/install.sh @@ -6,12 +6,11 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/hugo.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./hugo-debian.sh [Hugo version] [HUGO_DIR] [Non-root user] [Add rc files flag] -VERSION=${1:-"latest"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} +VERSION=${VERSION:-"latest"} + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} HUGO_DIR=${HUGO_DIR:-"/usr/local/hugo"} @@ -31,7 +30,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/java/devcontainer-feature.json b/src/java/devcontainer-feature.json new file mode 100644 index 0000000..64d5d65 --- /dev/null +++ b/src/java/devcontainer-feature.json @@ -0,0 +1,34 @@ +{ + "id": "java", + "name": "Java (via SDKMAN!)", + "options": { + "version": { + "type": "string", + "proposals": [ + "lts", + "latest", + "none", + "17", + "11", + "8" + ], + "default": "lts", + "description": "Select or enter a Java version to install" + } + }, + "buildArg": "_VSC_INSTALL_JAVA", + "extensions": [ + "vscjava.vscode-java-pack" + ], + "containerEnv": { + "SDKMAN_DIR": "/usr/local/sdkman", + "PATH": "${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH}" + }, + "settings": { + "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/java/feature.json b/src/java/feature.json deleted file mode 100644 index 64d5d65..0000000 --- a/src/java/feature.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "java", - "name": "Java (via SDKMAN!)", - "options": { - "version": { - "type": "string", - "proposals": [ - "lts", - "latest", - "none", - "17", - "11", - "8" - ], - "default": "lts", - "description": "Select or enter a Java version to install" - } - }, - "buildArg": "_VSC_INSTALL_JAVA", - "extensions": [ - "vscjava.vscode-java-pack" - ], - "containerEnv": { - "SDKMAN_DIR": "/usr/local/sdkman", - "PATH": "${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH}" - }, - "settings": { - "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/java/install.sh b/src/java/install.sh index f5880cd..7918568 100644 --- a/src/java/install.sh +++ b/src/java/install.sh @@ -9,10 +9,11 @@ # # Syntax: ./java-debian.sh [JDK version] [SDKMAN_DIR] [non-root user] [Add to rc files flag] -JAVA_VERSION=${1:-"lts"} -export SDKMAN_DIR=${2:-"/usr/local/sdkman"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} +JAVA_VERSION=${VERSION:-"lts"} + +export SDKMAN_DIR=${SDKMAN_DIR:-"/usr/local/sdkman"} +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} set -e @@ -30,7 +31,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/java/wrapper.sh b/src/java/wrapper.sh index 4d2aef3..d7f05de 100644 --- a/src/java/wrapper.sh +++ b/src/java/wrapper.sh @@ -27,7 +27,7 @@ if [ "${is_jdk_8}" = "true" ]; then # Determine the appropriate non-root user username="" possible_users=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for current_user in ${possible_users[@]}; do + for current_user in "${POSSIBLE_USERS[@]}"; do if id -u ${current_user} > /dev/null 2>&1; then username=${current_user} break diff --git a/src/jupyterlab/devcontainer-feature.json b/src/jupyterlab/devcontainer-feature.json new file mode 100644 index 0000000..8546925 --- /dev/null +++ b/src/jupyterlab/devcontainer-feature.json @@ -0,0 +1,33 @@ +{ + "id": "jupyterlab", + "name": "Jupyter Lab", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "3.6.2" + ], + "default": "latest", + "description": "Select or enter a jupyterlab version." + }, + "python_binary": { + "type": "string", + "proposals": [ + "python", + "/usr/local/python/bin/python" + ], + "default": "python", + "description": "Select or enter the python binary path." + } + }, + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-toolsai.jupyter" + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/jupyterlab/feature.json b/src/jupyterlab/feature.json deleted file mode 100644 index 86010c3..0000000 --- a/src/jupyterlab/feature.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "id": "jupyterlab", - "name": "Jupyter Lab", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "3.6.2"], - "default": "latest", - "description": "Select or enter a jupyterlab version." - }, - "pythonBinary": { - "type": "string", - "proposals": ["python", "/usr/local/python/bin/python"], - "default": "python", - "description": "Select or enter the python binary path." - } - }, - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance", - "ms-toolsai.jupyter" - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/jupyterlab/install.sh b/src/jupyterlab/install.sh index 4d426a4..f6c30d3 100644 --- a/src/jupyterlab/install.sh +++ b/src/jupyterlab/install.sh @@ -6,15 +6,14 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/jupyterlab.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./jupyter-debian.sh set -ex -VERSION=${1:-"latest"} -USERNAME=${2:-"automatic"} -PYTHON=${3:-"python"} -ALLOW_ALL_ORIGINS=${4:-""} +VERSION=${VERSION:-"latest"} +PYTHON=${PYTHON_BINARY:-"python"} + +USERNAME=${USERNAME:-"automatic"} +ALLOW_ALL_ORIGINS=${ALLOW_ALL_ORIGINS:-""} if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' @@ -25,7 +24,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/kubectl-helm-minikube/devcontainer-feature.json b/src/kubectl-helm-minikube/devcontainer-feature.json new file mode 100644 index 0000000..8b50879 --- /dev/null +++ b/src/kubectl-helm-minikube/devcontainer-feature.json @@ -0,0 +1,48 @@ +{ + "id": "kubectl-helm-minikube", + "name": "Kubectl, Helm, and Minkube", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "1.23", + "1.22", + "1.21" + ], + "default": "latest", + "description": "Select or enter a Kubernetes version to install" + }, + "helm": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter a Helm version to install" + }, + "minikube": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Select or enter a Minikube version to install" + } + }, + "extensions": [ + "ms-kubernetes-tools.vscode-kubernetes-tools" + ], + "mounts": [ + { + "source": "minikube-config", + "target": "/home/vscode/.minikube", + "type": "volume" + } + ], + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/kubectl-helm-minikube/feature.json b/src/kubectl-helm-minikube/feature.json deleted file mode 100644 index 7033c7a..0000000 --- a/src/kubectl-helm-minikube/feature.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "id": "kubectl-helm-minikube", - "name": "Kubectl, Helm, and Minkube", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "1.23", "1.22", "1.21"], - "default": "latest", - "description": "Select or enter a Kubernetes version to install" - }, - "helm": { - "type": "string", - "proposals": ["latest"], - "default": "latest", - "description": "Select or enter a Helm version to install" - }, - "minikube": { - "type": "string", - "proposals": ["latest"], - "default": "latest", - "description": "Select or enter a Minikube version to install" - } - }, - "extensions": [ - "ms-kubernetes-tools.vscode-kubernetes-tools" - ], - "mounts": [ - { - "source":"minikube-config", - "target":"/home/vscode/.minikube", - "type":"volume" - } - ], - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/kubectl-helm-minikube/install.sh b/src/kubectl-helm-minikube/install.sh index 0981024..b10f578 100644 --- a/src/kubectl-helm-minikube/install.sh +++ b/src/kubectl-helm-minikube/install.sh @@ -6,18 +6,17 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/kubectl-helm.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./kubectl-helm-debian.sh [kubectl verison] [Helm version] [minikube version] [kubectl SHA256] [Helm SHA256] [minikube SHA256] set -e -KUBECTL_VERSION="${1:-"latest"}" -HELM_VERSION="${2:-"latest"}" -MINIKUBE_VERSION="${3:-"none"}" # latest is also valid -KUBECTL_SHA256="${4:-"automatic"}" -HELM_SHA256="${5:-"automatic"}" -MINIKUBE_SHA256="${6:-"automatic"}" -USERNAME=${7:-"automatic"} +KUBECTL_VERSION="${VERSION:-"latest"}" +HELM_VERSION="${HELM:-"latest"}" +MINIKUBE_VERSION="${MINIKUBE:-"none"}" # latest is also valid + +KUBECTL_SHA256="${KUBECTL_SHA256:-"automatic"}" +HELM_SHA256="${HELM_SHA256:-"automatic"}" +MINIKUBE_SHA256="${MINIKUBE_SHA256:-"automatic"}" +USERNAME=${USERNAME:-"automatic"} HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS" GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80 @@ -33,7 +32,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/node/devcontainer-feature.json b/src/node/devcontainer-feature.json new file mode 100644 index 0000000..8d3bda6 --- /dev/null +++ b/src/node/devcontainer-feature.json @@ -0,0 +1,41 @@ +{ + "id": "node", + "name": "Node.js (via nvm) and yarn", + "options": { + "version": { + "type": "string", + "proposals": [ + "lts", + "latest", + "none", + "18", + "16", + "14" + ], + "default": "lts", + "description": "Select or enter a Node.js version to install" + }, + "install_tools_for_node_gyp": { + "type": "boolean", + "default": true, + "description": "Install dependencies to compile native node modules (node-gyp)?" + }, + "nvm_install_path": { + "type": "string", + "default": "/usr/local/share/nvm", + "description": "The path where NVM will be installed." + } + }, + "extensions": [ + "dbaeumer.vscode-eslint" + ], + "containerEnv": { + "NVM_DIR": "/usr/local/share/nvm", + "NVM_SYMLINK_CURRENT": "true", + "PATH": "${NVM_DIR}/current/bin:${PATH}" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/node/feature.json b/src/node/feature.json deleted file mode 100644 index fdb29cb..0000000 --- a/src/node/feature.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "id": "node", - "name": "Node.js (via nvm) and yarn", - "options": { - "version": { - "type": "string", - "proposals": [ "lts", "latest", "none", "18", "16", "14" ], - "default": "lts", - "description": "Select or enter a Node.js version to install" - }, - "nodeGypDependencies": { - "type": "boolean", - "default": true, - "description": "Install dependencies to compile native node modules (node-gyp)?" - }, - "nvmInstallPath": { - "type": "string", - "default": "/usr/local/share/nvm", - "description": "The path where NVM will be installed." - } - }, - "extensions": ["dbaeumer.vscode-eslint"], - "containerEnv": { - "NVM_DIR":"/usr/local/share/nvm", - "NVM_SYMLINK_CURRENT": "true", - "PATH": "${NVM_DIR}/current/bin:${PATH}" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/node/install.sh b/src/node/install.sh index 0b2190b..bb71c64 100644 --- a/src/node/install.sh +++ b/src/node/install.sh @@ -6,14 +6,14 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/node.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./node-debian.sh [directory to install nvm] [node version to install (use "none" to skip)] [non-root user] [Update rc files flag] [install node-gyp deps] -export NVM_DIR=${1:-"/usr/local/share/nvm"} -export NODE_VERSION=${2:-"lts"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} -INSTALL_TOOLS_FOR_NODE_GYP="${5:-true}" +export NODE_VERSION=${VERSION:-"lts"} +export NVM_DIR=${NVM_INSTALL_PATH:-"/usr/local/share/nvm"} +INSTALL_TOOLS_FOR_NODE_GYP="${INSTALL_TOOLS_FOR_NODE_GYP:-true}" + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} + export NVM_VERSION="0.38.0" set -e @@ -32,7 +32,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/oryx/devcontainer-feature.json b/src/oryx/devcontainer-feature.json new file mode 100644 index 0000000..c526893 --- /dev/null +++ b/src/oryx/devcontainer-feature.json @@ -0,0 +1,14 @@ +{ + "id": "oryx", + "name": "Oryx", + "containerEnv": { + "PATH": "usr/local/oryx:${PATH}", + "ORYX_SDK_STORAGE_BASE_URL": "https://oryx-cdn.microsoft.io", + "ENABLE_DYNAMIC_INSTALL": "true", + "DYNAMIC_INSTALL_ROOT_DIR": "/usr/local" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/oryx/feature.json b/src/oryx/feature.json deleted file mode 100644 index 10a468b..0000000 --- a/src/oryx/feature.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": "oryx", - "name": "Oryx", - "containerEnv": { - "PATH":"usr/local/oryx:${PATH}", - "ORYX_SDK_STORAGE_BASE_URL":"https://oryx-cdn.microsoft.io", - "ENABLE_DYNAMIC_INSTALL":"true", - "DYNAMIC_INSTALL_ROOT_DIR":"/usr/local" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/oryx/install.sh b/src/oryx/install.sh index 22c12d8..bdbe395 100755 --- a/src/oryx/install.sh +++ b/src/oryx/install.sh @@ -6,11 +6,9 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/hugo.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./oryx-debian.sh [Non-root user] -USERNAME=${1:-"automatic"} -UPDATE_RC=${2:-"true"} +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} set -eu @@ -28,7 +26,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/php/devcontainer-feature.json b/src/php/devcontainer-feature.json new file mode 100644 index 0000000..2832eb1 --- /dev/null +++ b/src/php/devcontainer-feature.json @@ -0,0 +1,39 @@ +{ + "id": "php", + "name": "PHP", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "8.0.16" + ], + "default": "latest", + "description": "Select or enter a PHP version" + }, + "install_composer": { + "type": "boolean", + "default": true, + "description": "Install PHP Composer?" + }, + "override_default_version": { + "type": "boolean", + "default": "true", + "description": "If true, overrides existing version (if any) of dotnet on the PATH" + } + }, + "extensions": [ + "xdebug.php-debug", + "bmewburn.vscode-intelephense-client", + "xdebug.php-pack", + "devsense.phptools-vscode" + ], + "containerEnv": { + "PHP_PATH": "/usr/local/php/current", + "PATH": "${PHP_PATH}:${PHP_PATH}/bin:${PATH}" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/php/feature.json b/src/php/feature.json deleted file mode 100644 index 4c5dcac..0000000 --- a/src/php/feature.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "php", - "name": "PHP", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "8.0.16"], - "default": "latest", - "description": "Select or enter a PHP version" - }, - "installComposer": { - "type": "boolean", - "default": true, - "description": "Install PHP Composer?" - }, - "overrideDefaultVersion": { - "type": "boolean", - "default": "true", - "description": "If true, overrides existing version (if any) of dotnet on the PATH" - } - }, - "extensions": [ - "xdebug.php-debug", - "bmewburn.vscode-intelephense-client", - "xdebug.php-pack", - "devsense.phptools-vscode" - ], - "containerEnv": { - "PHP_PATH": "/usr/local/php/current", - "PATH":"${PHP_PATH}:${PHP_PATH}/bin:${PATH}" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/php/install.sh b/src/php/install.sh index 125460d..7da6cb8 100644 --- a/src/php/install.sh +++ b/src/php/install.sh @@ -5,17 +5,17 @@ #------------------------------------------------------------------------------------------------------------- # # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./php-debian.sh [PHP version] [PHP_DIR] [Add Composer flag] [Non-root user] [Add rc files flag] - -VERSION=${1:-"latest"} -export PHP_DIR=${2:-"/usr/local/php"} -INSTALL_COMPOSER=${3:-"true"} -USERNAME=${4:-"automatic"} -UPDATE_RC=${5:-"true"} -OVERRIDE_DEFAULT_VERSION=${6:-"true"} set -eux + +VERSION=${VERSION:-"latest"} +INSTALL_COMPOSER=${INSTALL_COMPOSER:-"true"} +OVERRIDE_DEFAULT_VERSION=${OVERRIDE_DEFAULT_VERSION:-"true"} + +export PHP_DIR=${PHP_DIR:-"/usr/local/php"} +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} + export DEBIAN_FRONTEND=noninteractive if [ "$(id -u)" -ne 0 ]; then @@ -33,7 +33,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/powershell/devcontainer-feature.json b/src/powershell/devcontainer-feature.json new file mode 100644 index 0000000..07e838f --- /dev/null +++ b/src/powershell/devcontainer-feature.json @@ -0,0 +1,20 @@ +{ + "id": "powershell", + "name": "PowerShell", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "7.1" + ], + "default": "latest", + "description": "Select or enter a version of PowerShell." + } + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/powershell/feature.json b/src/powershell/feature.json deleted file mode 100644 index 842a629..0000000 --- a/src/powershell/feature.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "id": "powershell", - "name": "PowerShell", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "7.1"], - "default": "latest", - "description": "Select or enter a version of PowerShell." - } - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/powershell/install.sh b/src/powershell/install.sh index b8630c4..be60201 100644 --- a/src/powershell/install.sh +++ b/src/powershell/install.sh @@ -6,12 +6,11 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/powershell.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./powershell-debian.sh [version] set -e -POWERSHELL_VERSION=${1:-"latest"} +POWERSHELL_VERSION=${VERSION:-"latest"} + MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" POWERSHELL_ARCHIVE_ARCHITECTURES="amd64" POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal" diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json new file mode 100644 index 0000000..238b8d1 --- /dev/null +++ b/src/python/devcontainer-feature.json @@ -0,0 +1,68 @@ +{ + "id": "python", + "name": "Python (may require compilation)", + "description": "Python (may require compilation)", + "options": { + "version": { + "type": "string", + "enum": [ + "latest", + "os-provided", + "none", + "3.10", + "3.9", + "3.8", + "3.7", + "3.6" + ], + "default": "os-provided", + "description": "Select a Python version to install." + }, + "install_python_tools": { + "type": "boolean", + "default": true, + "description": "Install common Python tools like pylint" + }, + "optimize": { + "type": "boolean", + "default": false, + "description": "Optimize Python for performance when compiled (slow)" + }, + "installPath": { + "type": "string", + "default": "/usr/local/python", + "description": "The path where python will be installed." + }, + "override_default_version": { + "type": "boolean", + "default": "true", + "description": "If true, overrides existing version (if any) of python on the PATH" + } + }, + "containerEnv": { + "PYTHON_PATH": "/usr/local/python/current", + "PIPX_HOME": "/usr/local/py-utils", + "PIPX_BIN_DIR": "/usr/local/py-utils/bin", + "PATH": "${PYTHON_PATH}/bin:${PATH}:${PIPX_BIN_DIR}" + }, + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance" + ], + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", + "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", + "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", + "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", + "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", + "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", + "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/python/feature.json b/src/python/feature.json deleted file mode 100644 index 9f8543c..0000000 --- a/src/python/feature.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "id": "python", - "name": "Python (may require compilation)", - "description": "Python (may require compilation)", - "options": { - "version": { - "type": "string", - "enum": [ - "latest", - "os-provided", - "none", - "3.10", - "3.9", - "3.8", - "3.7", - "3.6" - ], - "default": "os-provided", - "description": "Select a Python version to install." - }, - "installTools": { - "type": "boolean", - "default": true, - "description": "Install common Python tools like pylint" - }, - "optimize": { - "type": "boolean", - "default": false, - "description": "Optimize Python for performance when compiled (slow)" - }, - "installPath": { - "type": "string", - "default": "/usr/local/python", - "description": "The path where python will be installed." - }, - "setup_links": { - "type": "boolean", - "default": "true", - "description": "If links and aliases should be created." - }, - "overrideDefaultVersion": { - "type": "boolean", - "default": "true", - "description": "If true, overrides existing version (if any) of python on the PATH" - } - }, - "containerEnv": { - "PYTHON_PATH": "/usr/local/python/current", - "PIPX_HOME": "/usr/local/py-utils", - "PIPX_BIN_DIR": "/usr/local/py-utils/bin", - "PATH": "${PYTHON_PATH}/bin:${PATH}:${PIPX_BIN_DIR}" - }, - "extensions": [ - "ms-python.python", - "ms-python.vscode-pylance" - ], - "settings": { - "python.defaultInterpreterPath": "/usr/local/bin/python", - "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", - "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/python/install.sh b/src/python/install.sh index ba0aa0a..ed273c0 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -6,18 +6,18 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/python.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./python-debian.sh [Python Version] [Python intall path] [PIPX_HOME] [non-root user] [Update rc files flag] [install tools flag] [Use Oryx if available flag] [Optimize when building from source flag] - -PYTHON_VERSION=${1:-"latest"} # 'system' checks the base image first, else installs 'latest' -PYTHON_INSTALL_PATH=${2:-"/usr/local/python"} -export PIPX_HOME=${3:-"/usr/local/py-utils"} -USERNAME=${4:-"automatic"} -UPDATE_RC=${5:-"true"} -INSTALL_PYTHON_TOOLS=${6:-"true"} -USE_ORYX_IF_AVAILABLE=${7:-"true"} -OPTIMIZE_BUILD_FROM_SOURCE=${8-"false"} -OVERRIDE_DEFAULT_VERSION=${9:-"true"} + +PYTHON_VERSION=${VERSION:-"latest"} # 'system' checks the base image first, else installs 'latest' +INSTALL_PYTHON_TOOLS=${INSTALL_PYTHON_TOOLS:-"true"} +OPTIMIZE_BUILD_FROM_SOURCE=${OPTIMIZE:-"false"} +PYTHON_INSTALL_PATH=${INSTALL_PATH:-"/usr/local/python"} +OVERRIDE_DEFAULT_VERSION=${OVERRIDE_DEFAULT_VERSION:-"true"} + +export PIPX_HOME=${PIPX_HOME:-"/usr/local/py-utils"} + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} +USE_ORYX_IF_AVAILABLE=${USE_ORYX_IF_AVAILABLE:-"true"} DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv") PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5" @@ -41,7 +41,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break @@ -365,7 +365,7 @@ if ! type pipx > /dev/null 2>&1; then /tmp/pip-tmp/bin/pipx install --pip-args=--no-cache-dir pipx pipx_path="/tmp/pip-tmp/bin/" fi -for util in ${DEFAULT_UTILS[@]}; do +for util in "${DEFAULT_UTILS[@]}"; do if ! type ${util} > /dev/null 2>&1; then ${pipx_path}pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' ${util} else diff --git a/src/ruby/devcontainer-feature.json b/src/ruby/devcontainer-feature.json new file mode 100644 index 0000000..919cf47 --- /dev/null +++ b/src/ruby/devcontainer-feature.json @@ -0,0 +1,25 @@ +{ + "id": "ruby", + "name": "Ruby (via rvm)", + "options": { + "version": { + "type": "string", + "proposals": ["latest", "none", "3.1", "3.0", "2.7"], + "default": "latest", + "description": "Select or enter a Ruby version to install" + } + }, + "extensions": [ + "rebornix.Ruby" + ], + "containerEnv": { + "GEM_PATH": "/usr/local/rvm/gems/default:/usr/local/rvm/gems/default@global", + "GEM_HOME": "/usr/local/rvm/gems/default", + "MY_RUBY_HOME": "/usr/local/rvm/rubies/default", + "PATH": "/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:${PATH}" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/ruby/feature.json b/src/ruby/feature.json deleted file mode 100644 index 919cf47..0000000 --- a/src/ruby/feature.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": "ruby", - "name": "Ruby (via rvm)", - "options": { - "version": { - "type": "string", - "proposals": ["latest", "none", "3.1", "3.0", "2.7"], - "default": "latest", - "description": "Select or enter a Ruby version to install" - } - }, - "extensions": [ - "rebornix.Ruby" - ], - "containerEnv": { - "GEM_PATH": "/usr/local/rvm/gems/default:/usr/local/rvm/gems/default@global", - "GEM_HOME": "/usr/local/rvm/gems/default", - "MY_RUBY_HOME": "/usr/local/rvm/rubies/default", - "PATH": "/usr/local/rvm/gems/default/bin:/usr/local/rvm/gems/default@global/bin:/usr/local/rvm/rubies/default/bin:${PATH}" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/ruby/install.sh b/src/ruby/install.sh index 3d3edbc..2e9b37a 100644 --- a/src/ruby/install.sh +++ b/src/ruby/install.sh @@ -6,13 +6,12 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/ruby.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./ruby-debian.sh [Ruby version] [non-root user] [Add to rc files flag] [Install tools flag] -RUBY_VERSION=${1:-"latest"} -USERNAME=${2:-"automatic"} -UPDATE_RC=${3:-"true"} -INSTALL_RUBY_TOOLS=${6:-"true"} +RUBY_VERSION=${VERSION:-"latest"} + +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} +INSTALL_RUBY_TOOLS=${INSTALL_RUBY_TOOLS:-"true"} # Note: ruby-debug-ide will install the right version of debase if missing and # installing debase directly fails on Ruby 3.1.0 as of 1/7/2022, so omitting. @@ -39,7 +38,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/rust/devcontainer-feature.json b/src/rust/devcontainer-feature.json new file mode 100644 index 0000000..147969f --- /dev/null +++ b/src/rust/devcontainer-feature.json @@ -0,0 +1,57 @@ +{ + "id": "rust", + "name": "Rust", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "1.55", + "1.54", + "1.53" + ], + "default": "latest", + "description": "Select or enter a version of Rust to install." + }, + "profile": { + "type": "string", + "proposals": [ + "minimal", + "default", + "complete" + ], + "default": "minimal", + "description": "Select a rustup install profile." + } + }, + "extensions": [ + "vadimcn.vscode-lldb", + "mutantdino.resourcemonitor", + "rust-lang.rust-analyzer", + "tamasfe.even-better-toml", + "serayuzgur.crates" + ], + "containerEnv": { + "CARGO_HOME": "/usr/local/cargo", + "RUSTUP_HOME": "/usr/local/rustup", + "PATH": "${CARGO_HOME}/bin:${PATH}" + }, + "capAdd": [ + "SYS_PTRACE" + ], + "securityOpt": [ + "seccomp=unconfined" + ], + "settings": { + "lldb.executable": "/usr/bin/lldb", + "files.watcherExclude": { + "**/target/**": true + }, + "rust-analyzer.checkOnSave.command": "clippy" + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/rust/feature.json b/src/rust/feature.json deleted file mode 100644 index 147969f..0000000 --- a/src/rust/feature.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "id": "rust", - "name": "Rust", - "options": { - "version": { - "type": "string", - "proposals": [ - "latest", - "none", - "1.55", - "1.54", - "1.53" - ], - "default": "latest", - "description": "Select or enter a version of Rust to install." - }, - "profile": { - "type": "string", - "proposals": [ - "minimal", - "default", - "complete" - ], - "default": "minimal", - "description": "Select a rustup install profile." - } - }, - "extensions": [ - "vadimcn.vscode-lldb", - "mutantdino.resourcemonitor", - "rust-lang.rust-analyzer", - "tamasfe.even-better-toml", - "serayuzgur.crates" - ], - "containerEnv": { - "CARGO_HOME": "/usr/local/cargo", - "RUSTUP_HOME": "/usr/local/rustup", - "PATH": "${CARGO_HOME}/bin:${PATH}" - }, - "capAdd": [ - "SYS_PTRACE" - ], - "securityOpt": [ - "seccomp=unconfined" - ], - "settings": { - "lldb.executable": "/usr/bin/lldb", - "files.watcherExclude": { - "**/target/**": true - }, - "rust-analyzer.checkOnSave.command": "clippy" - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/rust/install.sh b/src/rust/install.sh index 1d90b14..07a36a7 100644 --- a/src/rust/install.sh +++ b/src/rust/install.sh @@ -6,16 +6,15 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/rust.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./rust-debian.sh [CARGO_HOME] [RUSTUP_HOME] [non-root user] [add CARGO/RUSTUP_HOME to rc files flag] [whether to update rust] [Rust version] [rustup install profile] -export CARGO_HOME=${1:-"/usr/local/cargo"} -export RUSTUP_HOME=${2:-"/usr/local/rustup"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} -UPDATE_RUST=${5:-"false"} -RUST_VERSION=${6:-"latest"} -RUSTUP_PROFILE=${7:-"minimal"} +RUST_VERSION=${VERSION:-"latest"} +RUSTUP_PROFILE=${PROFILE:-"minimal"} + +export CARGO_HOME=${CARGO_HOME:-"/usr/local/cargo"} +export RUSTUP_HOME=${RUSTUP_HOME:-"/usr/local/rustup"} +USERNAME=${USERNAME:-"automatic"} +UPDATE_RC=${UPDATE_RC:-"true"} +UPDATE_RUST=${UPDATE_RUST:-"false"} set -e @@ -33,7 +32,7 @@ chmod +x /etc/profile.d/00-restore-env.sh if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/sshd/devcontainer-feature.json b/src/sshd/devcontainer-feature.json new file mode 100644 index 0000000..4de71d9 --- /dev/null +++ b/src/sshd/devcontainer-feature.json @@ -0,0 +1,17 @@ +{ + "id": "sshd", + "name": "SSH server", + "options": { + "version": { + "type": "string", + "enum": ["latest"], + "default": "latest", + "description": "Currently unused." + } + }, + "entrypoint": "/usr/local/share/ssh-init.sh", + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/sshd/feature.json b/src/sshd/feature.json deleted file mode 100644 index 4de71d9..0000000 --- a/src/sshd/feature.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "sshd", - "name": "SSH server", - "options": { - "version": { - "type": "string", - "enum": ["latest"], - "default": "latest", - "description": "Currently unused." - } - }, - "entrypoint": "/usr/local/share/ssh-init.sh", - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/sshd/install.sh b/src/sshd/install.sh index 3e8d2ec..4ee7893 100644 --- a/src/sshd/install.sh +++ b/src/sshd/install.sh @@ -7,15 +7,13 @@ # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/sshd.md # Maintainer: The VS Code and Codespaces Teams # -# Syntax: ./sshd-debian.sh [SSH Port (don't use 22)] [non-root user] [start sshd now flag] [new password for user] [fix environment flag] -# # Note: You can change your user's password with "sudo passwd $(whoami)" (or just "passwd" if running as root). -SSHD_PORT=${1:-"2222"} -USERNAME=${2:-"automatic"} -START_SSHD=${3:-"false"} -NEW_PASSWORD=${4:-"skip"} -FIX_ENVIRONMENT=${5:-"true"} +SSHD_PORT=${SSHD_PORT:-"2222"} +USERNAME=${USERNAME:-"automatic"} +START_SSHD=${START_SSHD:-"false"} +NEW_PASSWORD=${NEW_PASSWORD:-"skip"} +FIX_ENVIRONMENT=${FIX_ENVIRONMENT:-"true"} set -e @@ -28,7 +26,7 @@ fi if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do + for CURRENT_USER in "${POSSIBLE_USERS[@]}"; do if id -u ${CURRENT_USER} > /dev/null 2>&1; then USERNAME=${CURRENT_USER} break diff --git a/src/terraform/devcontainer-feature.json b/src/terraform/devcontainer-feature.json new file mode 100644 index 0000000..8af83a7 --- /dev/null +++ b/src/terraform/devcontainer-feature.json @@ -0,0 +1,49 @@ +{ + "id": "terraform", + "name": "Terraform, tflint, and TFGrunt", + "options": { + "version": { + "type": "string", + "proposals": [ + "latest", + "none", + "1.1", + "1.0", + "0.15" + ], + "default": "latest", + "description": "Terraform version" + }, + "tflint": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Tflint version" + }, + "terragrunt": { + "type": "string", + "proposals": [ + "latest" + ], + "default": "latest", + "description": "Terragrunt version" + } + }, + "extensions": [ + "HashiCorp.terraform", + "ms-azuretools.vscode-azureterraform" + ], + "settings": { + "terraform.languageServer": { + "enabled": true, + "args": [] + }, + "azureTerraform.terminal": "integrated", + }, + "install": { + "app": "", + "file": "install.sh" + } +} \ No newline at end of file diff --git a/src/terraform/feature.json b/src/terraform/feature.json deleted file mode 100644 index 8af83a7..0000000 --- a/src/terraform/feature.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": "terraform", - "name": "Terraform, tflint, and TFGrunt", - "options": { - "version": { - "type": "string", - "proposals": [ - "latest", - "none", - "1.1", - "1.0", - "0.15" - ], - "default": "latest", - "description": "Terraform version" - }, - "tflint": { - "type": "string", - "proposals": [ - "latest" - ], - "default": "latest", - "description": "Tflint version" - }, - "terragrunt": { - "type": "string", - "proposals": [ - "latest" - ], - "default": "latest", - "description": "Terragrunt version" - } - }, - "extensions": [ - "HashiCorp.terraform", - "ms-azuretools.vscode-azureterraform" - ], - "settings": { - "terraform.languageServer": { - "enabled": true, - "args": [] - }, - "azureTerraform.terminal": "integrated", - }, - "install": { - "app": "", - "file": "install.sh" - } -} \ No newline at end of file diff --git a/src/terraform/install.sh b/src/terraform/install.sh index f2614ae..3368374 100644 --- a/src/terraform/install.sh +++ b/src/terraform/install.sh @@ -6,17 +6,16 @@ # # Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/terraform.md # Maintainer: The VS Code and Codespaces Teams -# -# Syntax: ./terraform-debian.sh [terraform version] [tflint version] [terragrunt version] [terraform SHA] [tflint SHA] [terragrunt SHA] set -e -TERRAFORM_VERSION="${1:-"latest"}" -TFLINT_VERSION="${2:-"latest"}" -TERRAGRUNT_VERSION="${3:-"latest"}" -TERRAFORM_SHA256="${4:-"automatic"}" -TFLINT_SHA256="${5:-"automatic"}" -TERRAGRUNT_SHA256="${6:-"automatic"}" +TERRAFORM_VERSION="${VERSION:-"latest"}" +TFLINT_VERSION="${TFLINT:-"latest"}" +TERRAGRUNT_VERSION="${TERRAGRUNT:-"latest"}" + +TERRAFORM_SHA256="${TERRAFORM_SHA256:-"automatic"}" +TFLINT_SHA256="${TFLINT_SHA256:-"automatic"}" +TERRAGRUNT_SHA256="${TERRAGRUNT_SHA256:-"automatic"}" TERRAFORM_GPG_KEY="72D7468F" TFLINT_GPG_KEY_URI="https://raw.githubusercontent.com/terraform-linters/tflint/master/8CE69160EB3F2FE9.key" -- cgit v1.2.3