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"
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
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"
HELM_GPG_KEYS_URI="https://raw.githubusercontent.com/helm/helm/main/KEYS"
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
......
......@@ -56,6 +56,11 @@ package_list="
nano \
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
if [ "$(id -u)" -ne 0 ]; then
......@@ -164,6 +169,10 @@ check_packages() {
fi
}
##########################
# Install starts here #
##########################
# Ensure apt is in non-interactive to avoid prompts
export DEBIAN_FRONTEND=noninteractive
......@@ -191,6 +200,12 @@ fi
# Install X11, fluxbox and VS Code dependencies
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+
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
......@@ -391,4 +406,3 @@ In both cases, use the password "${VNC_PASSWORD}" when connecting
(*) Done!
EOF
......@@ -18,10 +18,12 @@ ACCESS_GROUP=${6:-"dotnet"}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
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
# https://github.com/dotnet/install-scripts/blob/1b98b94a6f6d81cc4845eb88e0195fac67caa0a6/src/dotnet-install.sh#L1342-L1343
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.
set -e
......@@ -295,7 +297,14 @@ install_using_dotnet_releases_url() {
# - libgcc-s1 OR libgcc1 depending on OS
# - the latest libicuXX depending on OS (eg libicu57 for stretch)
# - 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}"
# exports DOTNET_DOWNLOAD_URL, DOTNET_DOWNLOAD_HASH, DOTNET_DOWNLOAD_NAME
......@@ -343,6 +352,18 @@ EOF
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
# and set the appropriate variables.
if [ "${DOTNET_RUNTIME_ONLY}" = "true" ]; then
......@@ -362,13 +383,15 @@ architecture="$(dpkg --print-architecture)"
use_dotnet_releases_url="false"
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"
else
use_dotnet_releases_url="true"
fi
if [ "${use_dotnet_releases_url}" = "true" ]; then
install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}"
echo "Could not install dotnet from apt. Attempting to install dotnet from releases url"
install_using_dotnet_releases_url "${DOTNET_SDK_OR_RUNTIME}"
fi
echo "Done!"
\ No newline at end of file
......@@ -4,23 +4,31 @@
"options": {
"version": {
"type": "string",
"proposals": ["lts", "latest", "none", "17", "11", "8"],
"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"],
"extensions": [
"vscjava.vscode-java-pack"
],
"containerEnv": {
"SDKMAN_DIR": "/usr/local/sdkman",
"PATH": "${SDKMAN_DIR}/bin:${SDKMAN_DIR}/candidates/java/current/bin:${PATH}"
},
"settings": {
"java.home": "/extension-java-home",
"java.import.gradle.java.home": "/usr/local/sdkman/candidates/java/current"
},
"install": {
"app": "",
"file": "install.sh"
}
}
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ set -e
VERSION=${1:-"latest"}
USERNAME=${2:-"automatic"}
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 [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
......@@ -70,6 +70,7 @@ else
sudoUserIf ${PYTHON} -m pip install jupyterlab=="${VERSION}" --no-cache-dir
fi
if [ "${ALLOW_ORIGIN}" = 'true' ]; then
if [ "${ALLOW_ALL_ORIGINS}" = 'true' ]; then
addToJupyterConfig "c.ServerApp.allow_origin = '*'"
fi
addToJupyterConfig "c.NotebookApp.allow_origin = '*'"
fi
\ No newline at end of file
......@@ -122,7 +122,7 @@ install_using_apt() {
install_using_github() {
# 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
apt_get_update_if_needed
apt-get install -y --no-install-recommends git
......
......@@ -4,13 +4,23 @@
"options": {
"version": {
"type": "string",
"proposals": ["latest", "none", "1.55", "1.54", "1.53"],
"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"],
"proposals": [
"minimal",
"default",
"complete"
],
"default": "minimal",
"description": "Select a rustup install profile."
}
......@@ -18,7 +28,7 @@
"extensions": [
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"matklad.rust-analyzer",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates"
],
......@@ -27,8 +37,12 @@
"RUSTUP_HOME": "/usr/local/rustup",
"PATH": "${CARGO_HOME}/bin:${PATH}"
},
"capAdd": [ "SYS_PTRACE" ],
"securityOpt": ["seccomp=unconfined"],
"capAdd": [
"SYS_PTRACE"
],
"securityOpt": [
"seccomp=unconfined"
],
"settings": {
"lldb.executable": "/usr/bin/lldb",
"files.watcherExclude": {
......
......@@ -75,6 +75,13 @@ elif [ "${NEW_PASSWORD}" != "skip" ]; then
echo "${USERNAME}:${NEW_PASSWORD}" | chpasswd
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
if [ "${USERNAME}" != "root" ]; then
usermod -aG ssh ${USERNAME}
......@@ -166,4 +173,4 @@ echo -e "Done!\n\n- Port: ${SSHD_PORT}\n- User: ${USERNAME}"
if [ "${EMIT_PASSWORD}" = "true" ]; then
echo "- Password: ${NEW_PASSWORD}"
fi
echo -e "\nForward port ${SSHD_PORT} to your local machine and run:\n\n ssh -p ${SSHD_PORT} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${USERNAME}@localhost\n"
echo -e "\nForward port ${SSHD_PORT} to your local machine and run:\n\n ssh -p ${SSHD_PORT} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null ${USERNAME}@localhost\n"
\ No newline at end of file
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