Unverified Commit a4d434f2 authored by Josh Spicer's avatar Josh Spicer Committed by GitHub

sync with jammy updates (#21)

sync with jammy updates (https://github.com/microsoft/vscode-dev-containers/commit/053a0557211c98e5b9f0e8ccf755f6f143b05ef4) and other minor additions since copy over
parent 34346589
...@@ -13,7 +13,8 @@ POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal" ...@@ -13,7 +13,8 @@ POWERSHELL_ARCHIVE_VERSION_CODENAMES="stretch buster bionic focal"
AZCLI_ARCHIVE_ARCHITECTURES="amd64" AZCLI_ARCHIVE_ARCHITECTURES="amd64"
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal" AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
DOTNET_ARCHIVE_ARCHITECTURES="amd64" DOTNET_ARCHIVE_ARCHITECTURES="amd64"
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute" DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute jammy"
DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hirsute"
DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net" DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net"
HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS" HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS"
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
......
...@@ -56,6 +56,11 @@ package_list=" ...@@ -56,6 +56,11 @@ package_list="
nano \ nano \
locales" locales"
# Packages to attempt to install if essential tools are missing (ie: vncpasswd).
# This is useful, at least, for Ubuntu 22.04 (jammy)
package_list_additional="
tigervnc-tools"
set -e set -e
if [ "$(id -u)" -ne 0 ]; then if [ "$(id -u)" -ne 0 ]; then
...@@ -164,6 +169,10 @@ check_packages() { ...@@ -164,6 +169,10 @@ check_packages() {
fi fi
} }
##########################
# Install starts here #
##########################
# Ensure apt is in non-interactive to avoid prompts # Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
...@@ -191,6 +200,12 @@ fi ...@@ -191,6 +200,12 @@ fi
# Install X11, fluxbox and VS Code dependencies # Install X11, fluxbox and VS Code dependencies
check_packages ${package_list} check_packages ${package_list}
# On newer versions of Ubuntu (22.04),
# we need an additional package that isn't provided in earlier versions
if ! type vncpasswd > /dev/null 2>&1; then
check_packages ${package_list_additional}
fi
# Install Emoji font if available in distro - Available in Debian 10+, Ubuntu 18.04+ # Install Emoji font if available in distro - Available in Debian 10+, Ubuntu 18.04+
if dpkg-query -W fonts-noto-color-emoji > /dev/null 2>&1 && ! dpkg -s fonts-noto-color-emoji > /dev/null 2>&1; then if dpkg-query -W fonts-noto-color-emoji > /dev/null 2>&1 && ! dpkg -s fonts-noto-color-emoji > /dev/null 2>&1; then
apt-get -y install --no-install-recommends fonts-noto-color-emoji apt-get -y install --no-install-recommends fonts-noto-color-emoji
...@@ -391,4 +406,3 @@ In both cases, use the password "${VNC_PASSWORD}" when connecting ...@@ -391,4 +406,3 @@ In both cases, use the password "${VNC_PASSWORD}" when connecting
(*) Done! (*) Done!
EOF EOF
...@@ -18,10 +18,12 @@ ACCESS_GROUP=${6:-"dotnet"} ...@@ -18,10 +18,12 @@ ACCESS_GROUP=${6:-"dotnet"}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
DOTNET_ARCHIVE_ARCHITECTURES="amd64" DOTNET_ARCHIVE_ARCHITECTURES="amd64"
DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute" DOTNET_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute jammy"
# Feed URI sourced from the official dotnet-install.sh # Feed URI sourced from the official dotnet-install.sh
# https://github.com/dotnet/install-scripts/blob/1b98b94a6f6d81cc4845eb88e0195fac67caa0a6/src/dotnet-install.sh#L1342-L1343 # https://github.com/dotnet/install-scripts/blob/1b98b94a6f6d81cc4845eb88e0195fac67caa0a6/src/dotnet-install.sh#L1342-L1343
DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net" DOTNET_CDN_FEED_URI="https://dotnetcli.azureedge.net"
# Ubuntu 22.04 and on do not ship with libssl1.1, which is required for versions of .NET < 6.0
DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1="buster bullseye bionic focal hirsute"
# Exit on failure. # Exit on failure.
set -e set -e
...@@ -295,7 +297,14 @@ install_using_dotnet_releases_url() { ...@@ -295,7 +297,14 @@ install_using_dotnet_releases_url() {
# - libgcc-s1 OR libgcc1 depending on OS # - libgcc-s1 OR libgcc1 depending on OS
# - the latest libicuXX depending on OS (eg libicu57 for stretch) # - the latest libicuXX depending on OS (eg libicu57 for stretch)
# - also installs libc6 and libstdc++6 which are required by .NET # - also installs libc6 and libstdc++6 which are required by .NET
check_packages curl ca-certificates tar jq icu-devtools libgssapi-krb5-2 libssl1.1 zlib1g check_packages curl ca-certificates tar jq icu-devtools libgssapi-krb5-2 zlib1g
# Starting with Ubuntu 22.04 (jammy), libssl1.1 does not ship with the OS anymore.
if [[ "${DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1}" = *"${VERSION_CODENAME}"* ]]; then
check_packages libssl1.1
else
check_packages libssl3.0
fi
get_full_version_details "${sdk_or_runtime}" get_full_version_details "${sdk_or_runtime}"
# exports DOTNET_DOWNLOAD_URL, DOTNET_DOWNLOAD_HASH, DOTNET_DOWNLOAD_NAME # exports DOTNET_DOWNLOAD_URL, DOTNET_DOWNLOAD_HASH, DOTNET_DOWNLOAD_NAME
...@@ -343,6 +352,18 @@ EOF ...@@ -343,6 +352,18 @@ EOF
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
# Dotnet 3.1 and 5.0 are not supported on Ubuntu 22.04 (jammy)+,
# due to lack of libssl3.0 support.
# See: https://github.com/microsoft/vscode-dev-containers/issues/1458#issuecomment-1135077775
# NOTE: This will only guard against installation of the dotnet versions we propose via 'features'.
# The user can attempt to install any other version at their own risk.
if [[ "${DOTNET_VERSION}" = "3.1" ]] || [[ "${DOTNET_VERSION}" = "5.0" ]]; then
if [[ ! "${DOTNET_VERSION_CODENAMES_REQUIRE_OLDER_LIBSSL_1}" = *"${VERSION_CODENAME}"* ]]; then
err "Dotnet ${DOTNET_VERSION} is not supported on Ubuntu ${VERSION_CODENAME} due to a change in the 'libssl' dependency across distributions.\n Please upgrade your version of dotnet, or downgrade your OS version."
exit 1
fi
fi
# Determine if the user wants to download .NET Runtime only, or .NET SDK & Runtime # Determine if the user wants to download .NET Runtime only, or .NET SDK & Runtime
# and set the appropriate variables. # and set the appropriate variables.
if [ "${DOTNET_RUNTIME_ONLY}" = "true" ]; then if [ "${DOTNET_RUNTIME_ONLY}" = "true" ]; then
...@@ -362,12 +383,14 @@ architecture="$(dpkg --print-architecture)" ...@@ -362,12 +383,14 @@ architecture="$(dpkg --print-architecture)"
use_dotnet_releases_url="false" use_dotnet_releases_url="false"
if [[ "${DOTNET_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${DOTNET_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then if [[ "${DOTNET_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${DOTNET_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
echo "Detected ${VERSION_CODENAME} on ${architecture}. Attempting to install dotnet from apt"
install_using_apt "${DOTNET_SDK_OR_RUNTIME}" || use_dotnet_releases_url="true" install_using_apt "${DOTNET_SDK_OR_RUNTIME}" || use_dotnet_releases_url="true"
else else
use_dotnet_releases_url="true" use_dotnet_releases_url="true"
fi fi
if [ "${use_dotnet_releases_url}" = "true" ]; then if [ "${use_dotnet_releases_url}" = "true" ]; then
echo "Could not install dotnet from apt. Attempting to install dotnet from releases url"
install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}" install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}"
fi fi
......
...@@ -4,19 +4,27 @@ ...@@ -4,19 +4,27 @@
"options": { "options": {
"version": { "version": {
"type": "string", "type": "string",
"proposals": ["lts", "latest", "none", "17", "11", "8"], "proposals": [
"lts",
"latest",
"none",
"17",
"11",
"8"
],
"default": "lts", "default": "lts",
"description": "Select or enter a Java version to install" "description": "Select or enter a Java version to install"
} }
}, },
"buildArg": "_VSC_INSTALL_JAVA", "buildArg": "_VSC_INSTALL_JAVA",
"extensions": ["vscjava.vscode-java-pack"], "extensions": [
"vscjava.vscode-java-pack"
],
"containerEnv": { "containerEnv": {
"SDKMAN_DIR": "/usr/local/sdkman", "SDKMAN_DIR": "/usr/local/sdkman",
"PATH": "${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH}" "PATH": "${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH}"
}, },
"settings": { "settings": {
"java.home": "/extension-java-home",
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current" "java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current"
}, },
"install": { "install": {
......
...@@ -14,7 +14,7 @@ set -e ...@@ -14,7 +14,7 @@ set -e
VERSION=${1:-"latest"} VERSION=${1:-"latest"}
USERNAME=${2:-"automatic"} USERNAME=${2:-"automatic"}
PYTHON=${3:-"python"} PYTHON=${3:-"python"}
ALLOW_ORIGIN=${4:-""} ALLOW_ALL_ORIGINS=${4:-""}
# If in automatic mode, determine if a user already exists, if not use vscode # If in automatic mode, determine if a user already exists, if not use vscode
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
...@@ -70,6 +70,7 @@ else ...@@ -70,6 +70,7 @@ else
sudoUserIf ${PYTHON} -m pip install jupyterlab=="${VERSION}" --no-cache-dir sudoUserIf ${PYTHON} -m pip install jupyterlab=="${VERSION}" --no-cache-dir
fi fi
if [ "${ALLOW_ORIGIN}" = 'true' ]; then if [ "${ALLOW_ALL_ORIGINS}" = 'true' ]; then
addToJupyterConfig "c.ServerApp.allow_origin = '*'" addToJupyterConfig "c.ServerApp.allow_origin = '*'"
addToJupyterConfig "c.NotebookApp.allow_origin = '*'"
fi fi
\ No newline at end of file
...@@ -122,7 +122,7 @@ install_using_apt() { ...@@ -122,7 +122,7 @@ install_using_apt() {
install_using_github() { install_using_github() {
# Fall back on direct download if no apt package exists in microsoft pool # Fall back on direct download if no apt package exists in microsoft pool
check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 liblttng-ust0 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9] check_packages curl ca-certificates gnupg2 dirmngr libc6 libgcc1 libgssapi-krb5-2 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9]
if ! type git > /dev/null 2>&1; then if ! type git > /dev/null 2>&1; then
apt_get_update_if_needed apt_get_update_if_needed
apt-get install -y --no-install-recommends git apt-get install -y --no-install-recommends git
......
...@@ -4,13 +4,23 @@ ...@@ -4,13 +4,23 @@
"options": { "options": {
"version": { "version": {
"type": "string", "type": "string",
"proposals": ["latest", "none", "1.55", "1.54", "1.53"], "proposals": [
"latest",
"none",
"1.55",
"1.54",
"1.53"
],
"default": "latest", "default": "latest",
"description": "Select or enter a version of Rust to install." "description": "Select or enter a version of Rust to install."
}, },
"profile": { "profile": {
"type": "string", "type": "string",
"proposals": ["minimal", "default", "complete"], "proposals": [
"minimal",
"default",
"complete"
],
"default": "minimal", "default": "minimal",
"description": "Select a rustup install profile." "description": "Select a rustup install profile."
} }
...@@ -18,7 +28,7 @@ ...@@ -18,7 +28,7 @@
"extensions": [ "extensions": [
"vadimcn.vscode-lldb", "vadimcn.vscode-lldb",
"mutantdino.resourcemonitor", "mutantdino.resourcemonitor",
"matklad.rust-analyzer", "rust-lang.rust-analyzer",
"tamasfe.even-better-toml", "tamasfe.even-better-toml",
"serayuzgur.crates" "serayuzgur.crates"
], ],
...@@ -27,8 +37,12 @@ ...@@ -27,8 +37,12 @@
"RUSTUP_HOME": "/usr/local/rustup", "RUSTUP_HOME": "/usr/local/rustup",
"PATH": "${CARGO_HOME}/bin:${PATH}" "PATH": "${CARGO_HOME}/bin:${PATH}"
}, },
"capAdd": [ "SYS_PTRACE" ], "capAdd": [
"securityOpt": ["seccomp=unconfined"], "SYS_PTRACE"
],
"securityOpt": [
"seccomp=unconfined"
],
"settings": { "settings": {
"lldb.executable": "/usr/bin/lldb", "lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": { "files.watcherExclude": {
......
...@@ -75,6 +75,13 @@ elif [ "${NEW_PASSWORD}" != "skip" ]; then ...@@ -75,6 +75,13 @@ elif [ "${NEW_PASSWORD}" != "skip" ]; then
echo "${USERNAME}:${NEW_PASSWORD}" | chpasswd echo "${USERNAME}:${NEW_PASSWORD}" | chpasswd
fi fi
if [ $(getent group ssh) ]; then
echo "'ssh' group already exists."
else
echo "adding 'ssh' group, as it does not already exist."
groupadd ssh
fi
# Add user to ssh group # Add user to ssh group
if [ "${USERNAME}" != "root" ]; then if [ "${USERNAME}" != "root" ]; then
usermod -aG ssh ${USERNAME} usermod -aG ssh ${USERNAME}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment