From e33b54003c2d4070818e50b61ef6e7fb27f374e5 Mon Sep 17 00:00:00 2001 From: CI Date: Wed, 4 May 2022 19:30:10 +0000 Subject: [PATCH] Automated update of common script sources and hash --- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../docker-in-docker-debian.sh | 75 ++++++++++++++++--- .../library-scripts/github-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/common-debian.sh | 2 +- .../docker-in-docker-debian.sh | 75 ++++++++++++++++--- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../.devcontainer/Dockerfile | 4 +- containers/elixir/.devcontainer/Dockerfile | 4 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../docker-in-docker-debian.sh | 75 ++++++++++++++++--- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/docker-debian.sh | 22 ++++++ .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + .../library-scripts/common-debian.sh | 2 +- .../library-scripts/common-debian.sh | 2 +- .../library-scripts/node-debian.sh | 1 + 58 files changed, 414 insertions(+), 70 deletions(-) diff --git a/containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh b/containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh +++ b/containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh b/containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh b/containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh +++ b/containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh b/containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh +++ b/containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/azure-bicep/.devcontainer/library-scripts/node-debian.sh b/containers/azure-bicep/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/azure-bicep/.devcontainer/library-scripts/node-debian.sh +++ b/containers/azure-bicep/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/azure-cli/.devcontainer/library-scripts/common-debian.sh b/containers/azure-cli/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/azure-cli/.devcontainer/library-scripts/common-debian.sh +++ b/containers/azure-cli/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh b/containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh +++ b/containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh b/containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh +++ b/containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh b/containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh b/containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh +++ b/containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/bazel/.devcontainer/library-scripts/common-debian.sh b/containers/bazel/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/bazel/.devcontainer/library-scripts/common-debian.sh +++ b/containers/bazel/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh b/containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh +++ b/containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh b/containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh b/containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh index 2d37efc302..a525203b1a 100755 --- a/containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh +++ b/containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh @@ -15,14 +15,27 @@ 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 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" +# Default: Exit on any failure. set -e +# Setup STDERR. +err() { + echo "(!) $*" >&2 +} + 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.' + err 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 fi +################### +# Helper Functions +# See: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/shared/utils.sh +################### + # Determine the appropriate non-root user if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" @@ -97,20 +110,50 @@ find_version_from_git_tags() { declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)" else set +e - declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" + declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" set -e fi fi if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" > /dev/null 2>&1; then - echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 + err "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 exit 1 fi echo "${variable_name}=${!variable_name}" } +########################################### +# Start docker-in-docker installation +########################################### + # Ensure apt is in non-interactive to avoid prompts export DEBIAN_FRONTEND=noninteractive + +# Source /etc/os-release to get OS info +. /etc/os-release +# Fetch host/container arch. +architecture="$(dpkg --print-architecture)" + +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Install dependencies check_packages apt-transport-https curl ca-certificates pigz iptables gnupg2 dirmngr if ! type git > /dev/null 2>&1; then @@ -124,10 +167,7 @@ if type iptables-legacy > /dev/null 2>&1; then update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy fi -# Source /etc/os-release to get OS info -. /etc/os-release -# Fetch host/container arch. -architecture="$(dpkg --print-architecture)" + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then @@ -165,11 +205,11 @@ else # Regex needs to handle debian package version number format: https://www.systutorials.com/docs/linux/man/5-deb-version/ docker_version_regex="^(.+:)?${docker_version_dot_plus_escaped}([\\.\\+ ~:-]|$)" set +e # Don't exit if finding version fails - will handle gracefully - cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" - engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" set -e if [ -z "${engine_version_suffix}" ] || [ "${engine_version_suffix}" = "=" ] || [ -z "${cli_version_suffix}" ] || [ "${cli_version_suffix}" = "=" ] ; then - echo "(!) No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" + err "No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | grep -oP '^(.+:)?\K.+' exit 1 fi @@ -182,8 +222,17 @@ if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then echo "Docker / Moby CLI and Engine already installed." else if [ "${USE_MOBY}" = "true" ]; then - apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} - apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." + # Install engine + set +e # Handle error gracefully + apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} + if [ $? -ne 0 ]; then + err "Packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-20.04')." + exit 1 + fi + set -e + + # Install compose + apt-get -y install --no-install-recommends moby-compose || err "Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." else apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix} fi @@ -344,3 +393,5 @@ EOF chmod +x /usr/local/share/docker-init.sh chown ${USERNAME}:root /usr/local/share/docker-init.sh + +echo 'docker-in-docker-debian script has completed!' \ No newline at end of file diff --git a/containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh b/containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh index 978cc709c3..01ad4d493b 100755 --- a/containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh +++ b/containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh @@ -181,7 +181,7 @@ echo "Downloading github CLI..." # Import key safely (new method rather than deprecated apt-key approach) and install . /etc/os-release receive_gpg_keys GITHUB_CLI_ARCHIVE_GPG_KEY /usr/share/keyrings/githubcli-archive-keyring.gpg -echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/github-cli.list +echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list apt-get update apt-get -y install "gh${version_suffix}" rm -rf "/tmp/gh/gnupg" diff --git a/containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh b/containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh +++ b/containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh b/containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh b/containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/dart/.devcontainer/library-scripts/common-debian.sh b/containers/dart/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/dart/.devcontainer/library-scripts/common-debian.sh +++ b/containers/dart/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/debian/.devcontainer/library-scripts/common-debian.sh b/containers/debian/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/debian/.devcontainer/library-scripts/common-debian.sh +++ b/containers/debian/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh b/containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh +++ b/containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh b/containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh b/containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh +++ b/containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh b/containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh b/containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh +++ b/containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh b/containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh index 2d37efc302..a525203b1a 100755 --- a/containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh +++ b/containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh @@ -15,14 +15,27 @@ 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 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" +# Default: Exit on any failure. set -e +# Setup STDERR. +err() { + echo "(!) $*" >&2 +} + 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.' + err 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 fi +################### +# Helper Functions +# See: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/shared/utils.sh +################### + # Determine the appropriate non-root user if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" @@ -97,20 +110,50 @@ find_version_from_git_tags() { declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)" else set +e - declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" + declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" set -e fi fi if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" > /dev/null 2>&1; then - echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 + err "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 exit 1 fi echo "${variable_name}=${!variable_name}" } +########################################### +# Start docker-in-docker installation +########################################### + # Ensure apt is in non-interactive to avoid prompts export DEBIAN_FRONTEND=noninteractive + +# Source /etc/os-release to get OS info +. /etc/os-release +# Fetch host/container arch. +architecture="$(dpkg --print-architecture)" + +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Install dependencies check_packages apt-transport-https curl ca-certificates pigz iptables gnupg2 dirmngr if ! type git > /dev/null 2>&1; then @@ -124,10 +167,7 @@ if type iptables-legacy > /dev/null 2>&1; then update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy fi -# Source /etc/os-release to get OS info -. /etc/os-release -# Fetch host/container arch. -architecture="$(dpkg --print-architecture)" + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then @@ -165,11 +205,11 @@ else # Regex needs to handle debian package version number format: https://www.systutorials.com/docs/linux/man/5-deb-version/ docker_version_regex="^(.+:)?${docker_version_dot_plus_escaped}([\\.\\+ ~:-]|$)" set +e # Don't exit if finding version fails - will handle gracefully - cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" - engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" set -e if [ -z "${engine_version_suffix}" ] || [ "${engine_version_suffix}" = "=" ] || [ -z "${cli_version_suffix}" ] || [ "${cli_version_suffix}" = "=" ] ; then - echo "(!) No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" + err "No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | grep -oP '^(.+:)?\K.+' exit 1 fi @@ -182,8 +222,17 @@ if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then echo "Docker / Moby CLI and Engine already installed." else if [ "${USE_MOBY}" = "true" ]; then - apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} - apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." + # Install engine + set +e # Handle error gracefully + apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} + if [ $? -ne 0 ]; then + err "Packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-20.04')." + exit 1 + fi + set -e + + # Install compose + apt-get -y install --no-install-recommends moby-compose || err "Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." else apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix} fi @@ -344,3 +393,5 @@ EOF chmod +x /usr/local/share/docker-init.sh chown ${USERNAME}:root /usr/local/share/docker-init.sh + +echo 'docker-in-docker-debian script has completed!' \ No newline at end of file diff --git a/containers/dotnet/.devcontainer/library-scripts/common-debian.sh b/containers/dotnet/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/dotnet/.devcontainer/library-scripts/common-debian.sh +++ b/containers/dotnet/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/dotnet/.devcontainer/library-scripts/node-debian.sh b/containers/dotnet/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/dotnet/.devcontainer/library-scripts/node-debian.sh +++ b/containers/dotnet/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/elixir-phoenix-postgres/.devcontainer/Dockerfile b/containers/elixir-phoenix-postgres/.devcontainer/Dockerfile index da0b6c39a4..d6e20641d9 100644 --- a/containers/elixir-phoenix-postgres/.devcontainer/Dockerfile +++ b/containers/elixir-phoenix-postgres/.devcontainer/Dockerfile @@ -11,8 +11,8 @@ ARG USER_GID=$USER_UID # Options for common package install script ARG INSTALL_ZSH="true" ARG UPGRADE_PACKAGES="true" -ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh" -ARG COMMON_SCRIPT_SHA="dev-mode" +ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.234.0/script-library/common-debian.sh" +ARG COMMON_SCRIPT_SHA="ab4609258940b032d02ed08d4c776e9e66e1a2a21dd2f3313a8fc1c4fee607d0" # Optional Settings for Phoenix ARG PHOENIX_VERSION="1.6.2" diff --git a/containers/elixir/.devcontainer/Dockerfile b/containers/elixir/.devcontainer/Dockerfile index cb63d6ea2e..cb1d849260 100644 --- a/containers/elixir/.devcontainer/Dockerfile +++ b/containers/elixir/.devcontainer/Dockerfile @@ -11,8 +11,8 @@ ARG USER_GID=$USER_UID # Options for common package install script ARG INSTALL_ZSH="true" ARG UPGRADE_PACKAGES="true" -ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/script-library/common-debian.sh" -ARG COMMON_SCRIPT_SHA="dev-mode" +ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/v0.234.0/script-library/common-debian.sh" +ARG COMMON_SCRIPT_SHA="ab4609258940b032d02ed08d4c776e9e66e1a2a21dd2f3313a8fc1c4fee607d0" # Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. RUN apt-get update \ diff --git a/containers/go/.devcontainer/library-scripts/common-debian.sh b/containers/go/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/go/.devcontainer/library-scripts/common-debian.sh +++ b/containers/go/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/go/.devcontainer/library-scripts/node-debian.sh b/containers/go/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/go/.devcontainer/library-scripts/node-debian.sh +++ b/containers/go/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/haskell/.devcontainer/library-scripts/common-debian.sh b/containers/haskell/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/haskell/.devcontainer/library-scripts/common-debian.sh +++ b/containers/haskell/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/java/.devcontainer/library-scripts/common-debian.sh b/containers/java/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/java/.devcontainer/library-scripts/common-debian.sh +++ b/containers/java/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/java/.devcontainer/library-scripts/node-debian.sh b/containers/java/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/java/.devcontainer/library-scripts/node-debian.sh +++ b/containers/java/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/javascript-node/.devcontainer/library-scripts/common-debian.sh b/containers/javascript-node/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/javascript-node/.devcontainer/library-scripts/common-debian.sh +++ b/containers/javascript-node/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/javascript-node/.devcontainer/library-scripts/node-debian.sh b/containers/javascript-node/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/javascript-node/.devcontainer/library-scripts/node-debian.sh +++ b/containers/javascript-node/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh b/containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh +++ b/containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh b/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh +++ b/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh b/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh index 2d37efc302..a525203b1a 100755 --- a/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh +++ b/containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh @@ -15,14 +15,27 @@ 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 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" +# Default: Exit on any failure. set -e +# Setup STDERR. +err() { + echo "(!) $*" >&2 +} + 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.' + err 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' exit 1 fi +################### +# Helper Functions +# See: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/shared/utils.sh +################### + # Determine the appropriate non-root user if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then USERNAME="" @@ -97,20 +110,50 @@ find_version_from_git_tags() { declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)" else set +e - declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" + declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")" set -e fi fi if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" > /dev/null 2>&1; then - echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 + err "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2 exit 1 fi echo "${variable_name}=${!variable_name}" } +########################################### +# Start docker-in-docker installation +########################################### + # Ensure apt is in non-interactive to avoid prompts export DEBIAN_FRONTEND=noninteractive + +# Source /etc/os-release to get OS info +. /etc/os-release +# Fetch host/container arch. +architecture="$(dpkg --print-architecture)" + +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Install dependencies check_packages apt-transport-https curl ca-certificates pigz iptables gnupg2 dirmngr if ! type git > /dev/null 2>&1; then @@ -124,10 +167,7 @@ if type iptables-legacy > /dev/null 2>&1; then update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy fi -# Source /etc/os-release to get OS info -. /etc/os-release -# Fetch host/container arch. -architecture="$(dpkg --print-architecture)" + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then @@ -165,11 +205,11 @@ else # Regex needs to handle debian package version number format: https://www.systutorials.com/docs/linux/man/5-deb-version/ docker_version_regex="^(.+:)?${docker_version_dot_plus_escaped}([\\.\\+ ~:-]|$)" set +e # Don't exit if finding version fails - will handle gracefully - cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" - engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + cli_version_suffix="=$(apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" + engine_version_suffix="=$(apt-cache madison ${engine_package_name} | awk -F"|" '{print $2}' | sed -e 's/^[ \t]*//' | grep -E -m 1 "${docker_version_regex}")" set -e if [ -z "${engine_version_suffix}" ] || [ "${engine_version_suffix}" = "=" ] || [ -z "${cli_version_suffix}" ] || [ "${cli_version_suffix}" = "=" ] ; then - echo "(!) No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" + err "No full or partial Docker / Moby version match found for \"${DOCKER_VERSION}\" on OS ${ID} ${VERSION_CODENAME} (${architecture}). Available versions:" apt-cache madison ${cli_package_name} | awk -F"|" '{print $2}' | grep -oP '^(.+:)?\K.+' exit 1 fi @@ -182,8 +222,17 @@ if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then echo "Docker / Moby CLI and Engine already installed." else if [ "${USE_MOBY}" = "true" ]; then - apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} - apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." + # Install engine + set +e # Handle error gracefully + apt-get -y install --no-install-recommends moby-cli${cli_version_suffix} moby-buildx moby-engine${engine_version_suffix} + if [ $? -ne 0 ]; then + err "Packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-20.04')." + exit 1 + fi + set -e + + # Install compose + apt-get -y install --no-install-recommends moby-compose || err "Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping." else apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix} fi @@ -344,3 +393,5 @@ EOF chmod +x /usr/local/share/docker-init.sh chown ${USERNAME}:root /usr/local/share/docker-init.sh + +echo 'docker-in-docker-debian script has completed!' \ No newline at end of file diff --git a/containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh b/containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh +++ b/containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh b/containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh index 8b9316aded..1102ae99c5 100755 --- a/containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh +++ b/containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh @@ -17,6 +17,8 @@ USE_MOBY=${5:-"true"} DOCKER_VERSION=${6:-"latest"} DOCKER_DASH_COMPOSE_VERSION=${7:-"v1"} # v1 or v2 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" set -e @@ -125,6 +127,26 @@ fi # Fetch host/container arch. architecture="$(dpkg --print-architecture)" +# Check if distro is suppported +if [ "${USE_MOBY}" = "true" ]; then + # 'get_common_setting' allows attribute to be updated remotely + get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'" +else + get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES + if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then + err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution" + err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" + exit 1 + fi + echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'" +fi + # Set up the necessary apt repos (either Microsoft's or Docker's) if [ "${USE_MOBY}" = "true" ]; then diff --git a/containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh b/containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh +++ b/containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/perl/.devcontainer/library-scripts/common-debian.sh b/containers/perl/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/perl/.devcontainer/library-scripts/common-debian.sh +++ b/containers/perl/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/php/.devcontainer/library-scripts/common-debian.sh b/containers/php/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/php/.devcontainer/library-scripts/common-debian.sh +++ b/containers/php/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/php/.devcontainer/library-scripts/node-debian.sh b/containers/php/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/php/.devcontainer/library-scripts/node-debian.sh +++ b/containers/php/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/powershell/.devcontainer/library-scripts/common-debian.sh b/containers/powershell/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/powershell/.devcontainer/library-scripts/common-debian.sh +++ b/containers/powershell/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh b/containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh +++ b/containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh b/containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh +++ b/containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh b/containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh +++ b/containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/python-3/.devcontainer/library-scripts/common-debian.sh b/containers/python-3/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/python-3/.devcontainer/library-scripts/common-debian.sh +++ b/containers/python-3/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/python-3/.devcontainer/library-scripts/node-debian.sh b/containers/python-3/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/python-3/.devcontainer/library-scripts/node-debian.sh +++ b/containers/python-3/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/r/.devcontainer/library-scripts/common-debian.sh b/containers/r/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/r/.devcontainer/library-scripts/common-debian.sh +++ b/containers/r/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/ruby/.devcontainer/library-scripts/common-debian.sh b/containers/ruby/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/ruby/.devcontainer/library-scripts/common-debian.sh +++ b/containers/ruby/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/ruby/.devcontainer/library-scripts/node-debian.sh b/containers/ruby/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/ruby/.devcontainer/library-scripts/node-debian.sh +++ b/containers/ruby/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then diff --git a/containers/rust/.devcontainer/library-scripts/common-debian.sh b/containers/rust/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/rust/.devcontainer/library-scripts/common-debian.sh +++ b/containers/rust/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/swift/.devcontainer/library-scripts/common-debian.sh b/containers/swift/.devcontainer/library-scripts/common-debian.sh index af4facc8f6..2962684886 100755 --- a/containers/swift/.devcontainer/library-scripts/common-debian.sh +++ b/containers/swift/.devcontainer/library-scripts/common-debian.sh @@ -102,7 +102,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then libkrb5-3 \ libgssapi-krb5-2 \ libicu[0-9][0-9] \ - liblttng-ust0 \ + liblttng-ust[0-9] \ libstdc++6 \ zlib1g \ locales \ diff --git a/containers/swift/.devcontainer/library-scripts/node-debian.sh b/containers/swift/.devcontainer/library-scripts/node-debian.sh index c3551689c9..f782961880 100755 --- a/containers/swift/.devcontainer/library-scripts/node-debian.sh +++ b/containers/swift/.devcontainer/library-scripts/node-debian.sh @@ -126,6 +126,7 @@ su ${USERNAME} -c "$(cat << EOF umask 0002 # Do not update profile - we'll do this manually export PROFILE=/dev/null + ls -lah /home/${USERNAME}/.nvs || : curl -so- https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh | bash source ${NVM_DIR}/nvm.sh if [ "${NODE_VERSION}" != "" ]; then