Automated update for script library changes
This commit is contained in:
Родитель
253314b9ea
Коммит
f78722d250
1
container-templates/docker-compose/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
container-templates/docker-compose/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
1
container-templates/dockerfile/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
container-templates/dockerfile/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
2
containers/azure-ansible/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/azure-ansible/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
1
containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/azure-ansible/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/azure-ansible/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
8
containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/azure-ansible/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
2
containers/azure-bicep/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/azure-bicep/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
1
containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/azure-bicep/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
1
containers/azure-functions-dotnetcore-2.1/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/azure-functions-dotnetcore-2.1/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/azure-static-web-apps/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
2
containers/azure-terraform/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/azure-terraform/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
1
containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/azure-terraform/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/azure-terraform/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
8
containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/azure-terraform/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
2
containers/azure-terraform/.devcontainer/library-scripts/terraform-debian.sh
Normal file → Executable file
2
containers/azure-terraform/.devcontainer/library-scripts/terraform-debian.sh
Normal file → Executable file
|
@ -84,7 +84,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
2
containers/codespaces-linux/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/codespaces-linux/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
1
containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/codespaces-linux/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/codespaces-linux/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
20
containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
20
containers/codespaces-linux/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
|
@ -76,7 +76,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2 dirmngr
|
||||
|
||||
# Swap to legacy iptables for compatibility
|
||||
if type iptables-legacy > /dev/null 2>&1; then
|
||||
|
@ -85,6 +85,7 @@ if type iptables-legacy > /dev/null 2>&1; then
|
|||
fi
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI and Engine already installed."
|
||||
else
|
||||
|
@ -94,9 +95,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose moby-engine
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
@ -112,11 +114,11 @@ echo "Finished installing docker / moby"
|
|||
if type docker-compose > /dev/null 2>&1; then
|
||||
echo "Docker Compose already installed."
|
||||
else
|
||||
TARGET_COMPOSE_ARCH="$(uname -m)"
|
||||
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
|
||||
TARGET_COMPOSE_ARCH="x86_64"
|
||||
target_compose_arch="${architecture}"
|
||||
if [ "${target_compose_arch}" = "amd64" ]; then
|
||||
target_compose_arch="x86_64"
|
||||
fi
|
||||
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
|
||||
if [ "${target_compose_arch}" != "x86_64" ]; then
|
||||
# Use pip to get a version that runns on this architecture
|
||||
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
|
@ -135,8 +137,8 @@ else
|
|||
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' docker-compose
|
||||
rm -rf /tmp/pip-tmp
|
||||
else
|
||||
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
|
||||
latest_compose_version=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${latest_compose_version}/docker-compose-$(uname -s)-${target_compose_arch}" -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
fi
|
||||
fi
|
||||
|
|
4
containers/codespaces-linux/.devcontainer/library-scripts/git-from-src-debian.sh
Normal file → Executable file
4
containers/codespaces-linux/.devcontainer/library-scripts/git-from-src-debian.sh
Normal file → Executable file
|
@ -71,7 +71,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
# If ubuntu, PPAs allowed, and latest - install from there
|
||||
if ([ "${GIT_VERSION}" = "latest" ] || [ "${GIT_VERSION}" = "lts" ] || [ "${GIT_VERSION}" = "current" ]) && [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
|
||||
echo "Using PPA to install latest git..."
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
receive_gpg_keys GIT_CORE_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/gitcoreppa-archive-keyring.gpg
|
||||
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitcoreppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-core-ppa.list
|
||||
apt-get update
|
||||
|
|
58
containers/codespaces-linux/.devcontainer/library-scripts/git-lfs-debian.sh
Normal file → Executable file
58
containers/codespaces-linux/.devcontainer/library-scripts/git-lfs-debian.sh
Normal file → Executable file
|
@ -12,7 +12,7 @@
|
|||
GIT_LFS_VERSION=${1:-"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 bionic focal"
|
||||
GIT_LFS_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
|
||||
GIT_LFS_CHECKSUM_GPG_KEYS="0x88ace9b29196305ba9947552f1ba225c0223b187 0x86cd3297749375bcf8206715f54fe648088335a9 0xaa3b3450295830d2de6db90caba67be5a5795889"
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
|
@ -101,7 +101,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -125,24 +125,7 @@ check_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install git, curl, gpg, and debian-archive-keyring if missing
|
||||
. /etc/os-release
|
||||
check_packages curl ca-certificates gnupg2 apt-transport-https
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
if [ "${ID}" = "debian" ]; then
|
||||
check_packages debian-archive-keyring
|
||||
fi
|
||||
|
||||
|
||||
# Install Git LFS
|
||||
echo "Installing Git LFS..."
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if [[ "${GIT_LFS_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${GIT_LFS_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
|
||||
install_using_apt() {
|
||||
# Soft version matching
|
||||
if [ "${GIT_LFS_VERSION}" != "latest" ] && [ "${GIT_LFS_VERSION}" != "lts" ] && [ "${GIT_LFS_VERSION}" != "stable" ]; then
|
||||
find_version_from_git_tags GIT_LFS_VERSION "https://github.com/git-lfs/git-lfs"
|
||||
|
@ -154,10 +137,12 @@ if [[ "${GIT_LFS_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${GIT_
|
|||
get_common_setting GIT_LFS_ARCHIVE_GPG_KEY_URI
|
||||
curl -sSL "${GIT_LFS_ARCHIVE_GPG_KEY_URI}" | gpg --dearmor > /usr/share/keyrings/gitlfs-archive-keyring.gpg
|
||||
echo -e "deb [arch=${architecture} signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-lfs.list
|
||||
apt-get install -yq git-lfs${version_suffix}
|
||||
apt-get install -yq git-lfs${version_suffix} || return 1
|
||||
git lfs install --skip-repo
|
||||
else
|
||||
echo "No apt package for ${VERSION_CODENAME} ${architecture}. Installing manually."
|
||||
}
|
||||
|
||||
install_using_github() {
|
||||
echo "(*) No apt package for ${VERSION_CODENAME} ${architecture}. Installing manually."
|
||||
mkdir -p /tmp/git-lfs
|
||||
cd /tmp/git-lfs
|
||||
find_version_from_git_tags GIT_LFS_VERSION "https://github.com/git-lfs/git-lfs"
|
||||
|
@ -172,6 +157,33 @@ else
|
|||
tar xf "${git_lfs_filename}" -C .
|
||||
./install.sh
|
||||
rm -rf /tmp/git-lfs /tmp/tmp-gnupg
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install git, curl, gpg, dirmngr and debian-archive-keyring if missing
|
||||
. /etc/os-release
|
||||
check_packages curl ca-certificates gnupg2 dirmngr apt-transport-https
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
if [ "${ID}" = "debian" ]; then
|
||||
check_packages debian-archive-keyring
|
||||
fi
|
||||
|
||||
# Install Git LFS
|
||||
echo "Installing Git LFS..."
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if [[ "${GIT_LFS_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${GIT_LFS_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
|
||||
install_using_apt || use_github="true"
|
||||
else
|
||||
use_github="true"
|
||||
fi
|
||||
|
||||
# If no archive exists or apt install fails, try direct from github
|
||||
if [ "${use_github}" = "true" ]; then
|
||||
install_using_github
|
||||
fi
|
||||
|
||||
echo "Done!"
|
4
containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh
Normal file → Executable file
4
containers/codespaces-linux/.devcontainer/library-scripts/github-debian.sh
Normal file → Executable file
|
@ -65,7 +65,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
7
containers/codespaces-linux/.devcontainer/library-scripts/go-debian.sh
Normal file → Executable file
7
containers/codespaces-linux/.devcontainer/library-scripts/go-debian.sh
Normal file → Executable file
|
@ -48,13 +48,14 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Figure out correct version of a three part version number is not passed
|
||||
find_version_from_git_tags() {
|
||||
local variable_name=$1
|
||||
|
|
6
containers/codespaces-linux/.devcontainer/library-scripts/gradle-debian.sh
Normal file → Executable file
6
containers/codespaces-linux/.devcontainer/library-scripts/gradle-debian.sh
Normal file → Executable file
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
6
containers/codespaces-linux/.devcontainer/library-scripts/java-debian.sh
Normal file → Executable file
6
containers/codespaces-linux/.devcontainer/library-scripts/java-debian.sh
Normal file → Executable file
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
0
containers/codespaces-linux/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
0
containers/codespaces-linux/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
6
containers/codespaces-linux/.devcontainer/library-scripts/maven-debian.sh
Normal file → Executable file
6
containers/codespaces-linux/.devcontainer/library-scripts/maven-debian.sh
Normal file → Executable file
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
8
containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/codespaces-linux/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
34
containers/codespaces-linux/.devcontainer/library-scripts/powershell-debian.sh
Normal file → Executable file
34
containers/codespaces-linux/.devcontainer/library-scripts/powershell-debian.sh
Normal file → Executable file
|
@ -91,23 +91,20 @@ check_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Source /etc/os-release to get OS info
|
||||
. /etc/os-release
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
|
||||
install_using_apt() {
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update -yq
|
||||
apt-get install -yq powershell
|
||||
else
|
||||
# Fall back on direct download if no apt package exists in microsoft pool
|
||||
check_packages curl ca-certificates gnupg2 libc6 libgcc1 libgssapi-krb5-2 liblttng-ust0 libstdc++6 libunwind8 libuuid1 zlib1g libicu[0-9][0-9]
|
||||
apt-get install -yq powershell || return 1
|
||||
}
|
||||
|
||||
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]
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get install -y --no-install-recommends git
|
||||
|
@ -134,6 +131,21 @@ else
|
|||
tar xf "${powershell_filename}" -C "${powershell_target_path}"
|
||||
ln -s "${powershell_target_path}/pwsh" /usr/local/bin/pwsh
|
||||
rm -rf /tmp/pwsh
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Source /etc/os-release to get OS info
|
||||
. /etc/os-release
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if [[ "${POWERSHELL_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${POWERSHELL_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
|
||||
install_using_apt || use_github="true"
|
||||
else
|
||||
use_github="true"
|
||||
fi
|
||||
|
||||
if [ "${use_github}" = "true" ]; then
|
||||
install_using_github
|
||||
fi
|
||||
|
||||
echo "Done!"
|
234
containers/codespaces-linux/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
234
containers/codespaces-linux/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
|
@ -7,7 +7,7 @@
|
|||
# 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]
|
||||
# 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"}
|
||||
PYTHON_INSTALL_PATH=${2:-"/usr/local/python"}
|
||||
|
@ -15,9 +15,10 @@ export PIPX_HOME=${3:-"/usr/local/py-utils"}
|
|||
USERNAME=${4:-"automatic"}
|
||||
UPDATE_RC=${5:-"true"}
|
||||
INSTALL_PYTHON_TOOLS=${6:-"true"}
|
||||
USE_PPA_IF_AVAILABLE=${7:-"true"}
|
||||
USE_ORYX_IF_AVAILABLE=${7:-"true"}
|
||||
OPTIMIZE_BUILD_FROM_SOURCE=${8-"false"}
|
||||
|
||||
DEADSNAKES_PPA_ARCHIVE_GPG_KEY="F23C5A6CF475977595C89F51BA6932366A755776"
|
||||
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"
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
|
@ -55,8 +56,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -109,7 +112,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -148,6 +151,44 @@ find_version_from_git_tags() {
|
|||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
# Use Oryx to install something using a partial version match
|
||||
oryx_install() {
|
||||
local platform=$1
|
||||
local requested_version=$2
|
||||
local target_folder=${3:-none}
|
||||
local ldconfig_folder=${4:-none}
|
||||
echo "(*) Installing ${platform} ${requested_version} using Oryx..."
|
||||
check_packages jq
|
||||
# Soft match if full version not specified
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local version_list="$(oryx platforms --json | jq -r ".[] | select(.Name == \"${platform}\") | .Versions | sort | reverse | @tsv" | tr '\t' '\n' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
requested_version="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
if [ -z "${requested_version}" ] || ! echo "${version_list}" | grep "^${requested_version//./\\.}$" > /dev/null 2>&1; then
|
||||
echo -e "(!) Oryx does not support ${platform} version $2\nValid values:\n${version_list}" >&2
|
||||
return 1
|
||||
fi
|
||||
echo "(*) Using ${requested_version} in place of $2."
|
||||
fi
|
||||
|
||||
export ORYX_ENV_TYPE=vsonline-present ORYX_PREFER_USER_INSTALLED_SDKS=true ENABLE_DYNAMIC_INSTALL=true DYNAMIC_INSTALL_ROOT_DIR=/opt
|
||||
oryx prep --skip-detection --platforms-and-versions "${platform}=${requested_version}"
|
||||
local opt_folder="/opt/${platform}/${requested_version}"
|
||||
if [ "${target_folder}" != "none" ] && [ "${target_folder}" != "${opt_folder}" ]; then
|
||||
ln -s "${opt_folder}" "${target_folder}"
|
||||
fi
|
||||
# Update library path add to conf
|
||||
if [ "${ldconfig_folder}" != "none" ]; then
|
||||
echo "/opt/${platform}/${requested_version}/lib" >> "/etc/ld.so.conf.d/${platform}.conf"
|
||||
ldconfig
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run apt-get if needed
|
||||
apt_get_update_if_needed()
|
||||
{
|
||||
|
@ -167,76 +208,71 @@ check_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
install_from_ppa() {
|
||||
local requested_version="python${PYTHON_VERSION}"
|
||||
echo "Using PPA to install Python..."
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
receive_gpg_keys DEADSNAKES_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/deadsnakes-archive-keyring.gpg
|
||||
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/deadsnakes-ppa.list
|
||||
apt-get update
|
||||
if [ "${PYTHON_VERSION}" = "latest" ] || [ "${PYTHON_VERSION}" = "current" ] || [ "${PYTHON_VERSION}" = "lts" ]; then
|
||||
requested_version="$(apt-cache search '^python3\.[0-9]$' | grep -oE '^python3\.[0-9]' | sort -rV | head -n 1)"
|
||||
echo "Using ${requested_version} in place of ${PYTHON_VERSION}."
|
||||
fi
|
||||
apt-get -y install ${requested_version}
|
||||
rm -rf /tmp/tmp-gnupg
|
||||
exit 0
|
||||
}
|
||||
|
||||
install_from_source() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
else
|
||||
echo "Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates tar make build-essential libssl-dev zlib1g-dev \
|
||||
wget libbz2-dev libreadline-dev libxml2-dev xz-utils tk-dev gnupg2 \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev llvm dirmngr
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
TGZ_FILENAME="Python-${PYTHON_VERSION}.tgz"
|
||||
TGZ_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/${TGZ_FILENAME}"
|
||||
echo "Downloading ${TGZ_FILENAME}..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}" "${TGZ_URL}"
|
||||
|
||||
# Verify signature
|
||||
if [ "${SKIP_SIGNATURE_CHECK}" != "true" ]; then
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${TGZ_FILENAME}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}.asc" "${TGZ_URL}.asc"
|
||||
gpg --verify "${TGZ_FILENAME}.asc"
|
||||
fi
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${TGZ_FILENAME}" -C "/tmp/python-src" --strip-components=1
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --enable-optimizations --with-ensurepip=install
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
updaterc "export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}"
|
||||
fi
|
||||
echo "(*) Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
|
||||
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
local tgz_filename="Python-${PYTHON_VERSION}.tgz"
|
||||
local tgz_url="https://www.python.org/ftp/python/${PYTHON_VERSION}/${tgz_filename}"
|
||||
echo "Downloading ${tgz_filename}..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}" "${tgz_url}"
|
||||
|
||||
# Verify signature
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${tgz_filename}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}.asc" "${tgz_url}.asc"
|
||||
gpg --verify "${tgz_filename}.asc"
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${tgz_filename}" -C "/tmp/python-src" --strip-components=1
|
||||
local config_args=""
|
||||
if [ "${OPTIMIZE_BUILD_FROM_SOURCE}" = "true" ]; then
|
||||
config_args="--enable-optimizations"
|
||||
fi
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --with-ensurepip=install ${config_args}
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
install_using_oryx() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
fi
|
||||
oryx_install "python" "${PYTHON_VERSION}" "${PYTHON_INSTALL_PATH}" "lib" || return 1
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
# Ensure apt is in non-interactive to avoid prompts
|
||||
|
@ -244,41 +280,25 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
# Install python from source if needed
|
||||
if [ "${PYTHON_VERSION}" != "none" ]; then
|
||||
# Source /etc/os-release to get OS info
|
||||
. /etc/os-release
|
||||
# If ubuntu, PPAs allowed - install from there
|
||||
if [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
|
||||
install_from_ppa
|
||||
if [ "$(dpkg --print-architecture)" = "amd64" ] && [ "${USE_ORYX_IF_AVAILABLE}" = "true" ] && type oryx > /dev/null 2>&1; then
|
||||
install_using_oryx || should_install_from_source=true
|
||||
else
|
||||
should_install_from_source=true
|
||||
fi
|
||||
if [ "${should_install_from_source}" = "true" ]; then
|
||||
install_from_source
|
||||
fi
|
||||
updaterc "if [[ \"\${PATH}\" != *\"${PYTHON_INSTALL_PATH}/bin\"* ]]; then export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}; fi"
|
||||
fi
|
||||
|
||||
# If not installing python tools, exit
|
||||
if [ "${INSTALL_PYTHON_TOOLS}" != "true" ]; then
|
||||
echo "Done!"
|
||||
exit 0;
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEFAULT_UTILS="\
|
||||
pylint \
|
||||
flake8 \
|
||||
autopep8 \
|
||||
black \
|
||||
yapf \
|
||||
mypy \
|
||||
pydocstyle \
|
||||
pycodestyle \
|
||||
bandit \
|
||||
pipenv \
|
||||
virtualenv"
|
||||
|
||||
export PIPX_BIN_DIR=${PIPX_HOME}/bin
|
||||
export PATH=${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
python3 -m pip install --no-cache-dir --upgrade pip
|
||||
export PIPX_BIN_DIR="${PIPX_HOME}/bin"
|
||||
export PATH="${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}"
|
||||
|
||||
# Create pipx group, dir, and set sticky bit
|
||||
if ! cat /etc/group | grep -e "^pipx:" > /dev/null 2>&1; then
|
||||
|
@ -290,13 +310,27 @@ mkdir -p ${PIPX_BIN_DIR}
|
|||
chown :pipx ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
chmod g+s ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
${PYTHON_INSTALL_PATH}/bin/python3 -m pip install --no-cache-dir --upgrade pip
|
||||
|
||||
# Install tools
|
||||
echo "Installing Python tools..."
|
||||
export PYTHONUSERBASE=/tmp/pip-tmp
|
||||
export PIP_CACHE_DIR=/tmp/pip-tmp/cache
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/tmp/pip-tmp/bin/pipx install --pip-args=--no-cache-dir pipx
|
||||
echo "${DEFAULT_UTILS}" | xargs -n 1 /tmp/pip-tmp/bin/pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall'
|
||||
pipx_path=""
|
||||
if ! type pipx > /dev/null 2>&1; then
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/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
|
||||
if ! type ${util} > /dev/null 2>&1; then
|
||||
${pipx_path}pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' ${util}
|
||||
else
|
||||
echo "${util} already installed. Skipping."
|
||||
fi
|
||||
done
|
||||
rm -rf /tmp/pip-tmp
|
||||
|
||||
updaterc "$(cat << EOF
|
||||
|
|
8
containers/codespaces-linux/.devcontainer/library-scripts/ruby-debian.sh
Normal file → Executable file
8
containers/codespaces-linux/.devcontainer/library-scripts/ruby-debian.sh
Normal file → Executable file
|
@ -52,8 +52,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -105,7 +107,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
6
containers/codespaces-linux/.devcontainer/library-scripts/rust-debian.sh
Normal file → Executable file
6
containers/codespaces-linux/.devcontainer/library-scripts/rust-debian.sh
Normal file → Executable file
|
@ -47,8 +47,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
0
containers/codespaces-linux/.devcontainer/library-scripts/sshd-debian.sh
Normal file → Executable file
0
containers/codespaces-linux/.devcontainer/library-scripts/sshd-debian.sh
Normal file → Executable file
2
containers/dapr-dotnet/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/dapr-dotnet/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
8
containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/dapr-dotnet/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
8
containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/dapr-javascript-node/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
1
containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/docker-from-docker-compose/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/docker-from-docker-compose/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
1
containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/docker-from-docker/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/docker-from-docker/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
1
containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/docker-in-docker/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
20
containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
20
containers/docker-in-docker/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
|
@ -76,7 +76,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2 dirmngr
|
||||
|
||||
# Swap to legacy iptables for compatibility
|
||||
if type iptables-legacy > /dev/null 2>&1; then
|
||||
|
@ -85,6 +85,7 @@ if type iptables-legacy > /dev/null 2>&1; then
|
|||
fi
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI and Engine already installed."
|
||||
else
|
||||
|
@ -94,9 +95,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose moby-engine
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
@ -112,11 +114,11 @@ echo "Finished installing docker / moby"
|
|||
if type docker-compose > /dev/null 2>&1; then
|
||||
echo "Docker Compose already installed."
|
||||
else
|
||||
TARGET_COMPOSE_ARCH="$(uname -m)"
|
||||
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
|
||||
TARGET_COMPOSE_ARCH="x86_64"
|
||||
target_compose_arch="${architecture}"
|
||||
if [ "${target_compose_arch}" = "amd64" ]; then
|
||||
target_compose_arch="x86_64"
|
||||
fi
|
||||
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
|
||||
if [ "${target_compose_arch}" != "x86_64" ]; then
|
||||
# Use pip to get a version that runns on this architecture
|
||||
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
|
@ -135,8 +137,8 @@ else
|
|||
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' docker-compose
|
||||
rm -rf /tmp/pip-tmp
|
||||
else
|
||||
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
|
||||
latest_compose_version=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${latest_compose_version}/docker-compose-$(uname -s)-${target_compose_arch}" -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
fi
|
||||
fi
|
||||
|
|
2
containers/dotnet-fsharp/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/dotnet-fsharp/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
2
containers/dotnet-mssql/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
2
containers/dotnet-mssql/.devcontainer/library-scripts/azcli-debian.sh
Normal file → Executable file
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
|
@ -58,7 +58,7 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
architecture="$(dpkg --print-architecture)"
|
||||
if [ "${architecture}" = "amd64" ]; then
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
. /etc/os-release
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,13 +48,14 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Figure out correct version of a three part version number is not passed
|
||||
find_version_from_git_tags() {
|
||||
local variable_name=$1
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -46,8 +46,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
1
containers/javascript-node/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/javascript-node/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/javascript-node/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/javascript-node/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
1
containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/jupyter-datascience-notebooks/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
1
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
20
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
20
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/docker-in-docker-debian.sh
Normal file → Executable file
|
@ -76,7 +76,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates lxc pigz iptables gnupg2 dirmngr
|
||||
|
||||
# Swap to legacy iptables for compatibility
|
||||
if type iptables-legacy > /dev/null 2>&1; then
|
||||
|
@ -85,6 +85,7 @@ if type iptables-legacy > /dev/null 2>&1; then
|
|||
fi
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1 && type dockerd > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI and Engine already installed."
|
||||
else
|
||||
|
@ -94,9 +95,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose moby-engine
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
@ -112,11 +114,11 @@ echo "Finished installing docker / moby"
|
|||
if type docker-compose > /dev/null 2>&1; then
|
||||
echo "Docker Compose already installed."
|
||||
else
|
||||
TARGET_COMPOSE_ARCH="$(uname -m)"
|
||||
if [ "${TARGET_COMPOSE_ARCH}" = "amd64" ]; then
|
||||
TARGET_COMPOSE_ARCH="x86_64"
|
||||
target_compose_arch="${architecture}"
|
||||
if [ "${target_compose_arch}" = "amd64" ]; then
|
||||
target_compose_arch="x86_64"
|
||||
fi
|
||||
if [ "${TARGET_COMPOSE_ARCH}" != "x86_64" ]; then
|
||||
if [ "${target_compose_arch}" != "x86_64" ]; then
|
||||
# Use pip to get a version that runns on this architecture
|
||||
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
|
@ -135,8 +137,8 @@ else
|
|||
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' docker-compose
|
||||
rm -rf /tmp/pip-tmp
|
||||
else
|
||||
LATEST_COMPOSE_VERSION=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${LATEST_COMPOSE_VERSION}/docker-compose-$(uname -s)-${TARGET_COMPOSE_ARCH}" -o /usr/local/bin/docker-compose
|
||||
latest_compose_version=$(basename "$(curl -fsSL -o /dev/null -w "%{url_effective}" https://github.com/docker/compose/releases/latest)")
|
||||
curl -fsSL "https://github.com/docker/compose/releases/download/${latest_compose_version}/docker-compose-$(uname -s)-${target_compose_arch}" -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
fi
|
||||
fi
|
||||
|
|
0
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
0
containers/kubernetes-helm-minikube/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
1
containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/kubernetes-helm/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
8
containers/kubernetes-helm/.devcontainer/library-scripts/docker-debian.sh
Normal file → Executable file
|
@ -78,9 +78,10 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
|
||||
|
||||
# Install Docker / Moby CLI if not already installed
|
||||
architecture="$(dpkg --print-architecture)"
|
||||
if type docker > /dev/null 2>&1; then
|
||||
echo "Docker / Moby CLI already installed."
|
||||
else
|
||||
|
@ -90,9 +91,10 @@ else
|
|||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
get_common_setting MICROSOFT_GPG_KEYS_URI
|
||||
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
|
||||
apt-get update
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-compose
|
||||
apt-get -y install --no-install-recommends moby-cli moby-buildx moby-engine
|
||||
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for ${VERSION_CODENAME} ${architecture}. Skipping."
|
||||
else
|
||||
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
|
||||
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
|
0
containers/kubernetes-helm/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
0
containers/kubernetes-helm/.devcontainer/library-scripts/kubectl-helm-debian.sh
Normal file → Executable file
1
containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/mit-scheme/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
1
containers/powershell/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/powershell/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
1
containers/python-3-anaconda/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/python-3-anaconda/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/python-3-anaconda/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
1
containers/python-3-miniconda/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/python-3-miniconda/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
8
containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
8
containers/python-3-miniconda/.devcontainer/library-scripts/node-debian.sh
Normal file → Executable file
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
234
containers/python-3-miniconda/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
234
containers/python-3-miniconda/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
|
@ -7,7 +7,7 @@
|
|||
# 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]
|
||||
# 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"}
|
||||
PYTHON_INSTALL_PATH=${2:-"/usr/local/python"}
|
||||
|
@ -15,9 +15,10 @@ export PIPX_HOME=${3:-"/usr/local/py-utils"}
|
|||
USERNAME=${4:-"automatic"}
|
||||
UPDATE_RC=${5:-"true"}
|
||||
INSTALL_PYTHON_TOOLS=${6:-"true"}
|
||||
USE_PPA_IF_AVAILABLE=${7:-"true"}
|
||||
USE_ORYX_IF_AVAILABLE=${7:-"true"}
|
||||
OPTIMIZE_BUILD_FROM_SOURCE=${8-"false"}
|
||||
|
||||
DEADSNAKES_PPA_ARCHIVE_GPG_KEY="F23C5A6CF475977595C89F51BA6932366A755776"
|
||||
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"
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
|
@ -55,8 +56,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -109,7 +112,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -148,6 +151,44 @@ find_version_from_git_tags() {
|
|||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
# Use Oryx to install something using a partial version match
|
||||
oryx_install() {
|
||||
local platform=$1
|
||||
local requested_version=$2
|
||||
local target_folder=${3:-none}
|
||||
local ldconfig_folder=${4:-none}
|
||||
echo "(*) Installing ${platform} ${requested_version} using Oryx..."
|
||||
check_packages jq
|
||||
# Soft match if full version not specified
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local version_list="$(oryx platforms --json | jq -r ".[] | select(.Name == \"${platform}\") | .Versions | sort | reverse | @tsv" | tr '\t' '\n' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
requested_version="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
if [ -z "${requested_version}" ] || ! echo "${version_list}" | grep "^${requested_version//./\\.}$" > /dev/null 2>&1; then
|
||||
echo -e "(!) Oryx does not support ${platform} version $2\nValid values:\n${version_list}" >&2
|
||||
return 1
|
||||
fi
|
||||
echo "(*) Using ${requested_version} in place of $2."
|
||||
fi
|
||||
|
||||
export ORYX_ENV_TYPE=vsonline-present ORYX_PREFER_USER_INSTALLED_SDKS=true ENABLE_DYNAMIC_INSTALL=true DYNAMIC_INSTALL_ROOT_DIR=/opt
|
||||
oryx prep --skip-detection --platforms-and-versions "${platform}=${requested_version}"
|
||||
local opt_folder="/opt/${platform}/${requested_version}"
|
||||
if [ "${target_folder}" != "none" ] && [ "${target_folder}" != "${opt_folder}" ]; then
|
||||
ln -s "${opt_folder}" "${target_folder}"
|
||||
fi
|
||||
# Update library path add to conf
|
||||
if [ "${ldconfig_folder}" != "none" ]; then
|
||||
echo "/opt/${platform}/${requested_version}/lib" >> "/etc/ld.so.conf.d/${platform}.conf"
|
||||
ldconfig
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run apt-get if needed
|
||||
apt_get_update_if_needed()
|
||||
{
|
||||
|
@ -167,76 +208,71 @@ check_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
install_from_ppa() {
|
||||
local requested_version="python${PYTHON_VERSION}"
|
||||
echo "Using PPA to install Python..."
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
receive_gpg_keys DEADSNAKES_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/deadsnakes-archive-keyring.gpg
|
||||
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/deadsnakes-ppa.list
|
||||
apt-get update
|
||||
if [ "${PYTHON_VERSION}" = "latest" ] || [ "${PYTHON_VERSION}" = "current" ] || [ "${PYTHON_VERSION}" = "lts" ]; then
|
||||
requested_version="$(apt-cache search '^python3\.[0-9]$' | grep -oE '^python3\.[0-9]' | sort -rV | head -n 1)"
|
||||
echo "Using ${requested_version} in place of ${PYTHON_VERSION}."
|
||||
fi
|
||||
apt-get -y install ${requested_version}
|
||||
rm -rf /tmp/tmp-gnupg
|
||||
exit 0
|
||||
}
|
||||
|
||||
install_from_source() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
else
|
||||
echo "Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates tar make build-essential libssl-dev zlib1g-dev \
|
||||
wget libbz2-dev libreadline-dev libxml2-dev xz-utils tk-dev gnupg2 \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev llvm dirmngr
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
TGZ_FILENAME="Python-${PYTHON_VERSION}.tgz"
|
||||
TGZ_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/${TGZ_FILENAME}"
|
||||
echo "Downloading ${TGZ_FILENAME}..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}" "${TGZ_URL}"
|
||||
|
||||
# Verify signature
|
||||
if [ "${SKIP_SIGNATURE_CHECK}" != "true" ]; then
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${TGZ_FILENAME}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}.asc" "${TGZ_URL}.asc"
|
||||
gpg --verify "${TGZ_FILENAME}.asc"
|
||||
fi
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${TGZ_FILENAME}" -C "/tmp/python-src" --strip-components=1
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --enable-optimizations --with-ensurepip=install
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
updaterc "export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}"
|
||||
fi
|
||||
echo "(*) Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
|
||||
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
local tgz_filename="Python-${PYTHON_VERSION}.tgz"
|
||||
local tgz_url="https://www.python.org/ftp/python/${PYTHON_VERSION}/${tgz_filename}"
|
||||
echo "Downloading ${tgz_filename}..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}" "${tgz_url}"
|
||||
|
||||
# Verify signature
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${tgz_filename}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}.asc" "${tgz_url}.asc"
|
||||
gpg --verify "${tgz_filename}.asc"
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${tgz_filename}" -C "/tmp/python-src" --strip-components=1
|
||||
local config_args=""
|
||||
if [ "${OPTIMIZE_BUILD_FROM_SOURCE}" = "true" ]; then
|
||||
config_args="--enable-optimizations"
|
||||
fi
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --with-ensurepip=install ${config_args}
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
install_using_oryx() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
fi
|
||||
oryx_install "python" "${PYTHON_VERSION}" "${PYTHON_INSTALL_PATH}" "lib" || return 1
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
# Ensure apt is in non-interactive to avoid prompts
|
||||
|
@ -244,41 +280,25 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
# Install python from source if needed
|
||||
if [ "${PYTHON_VERSION}" != "none" ]; then
|
||||
# Source /etc/os-release to get OS info
|
||||
. /etc/os-release
|
||||
# If ubuntu, PPAs allowed - install from there
|
||||
if [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
|
||||
install_from_ppa
|
||||
if [ "$(dpkg --print-architecture)" = "amd64" ] && [ "${USE_ORYX_IF_AVAILABLE}" = "true" ] && type oryx > /dev/null 2>&1; then
|
||||
install_using_oryx || should_install_from_source=true
|
||||
else
|
||||
should_install_from_source=true
|
||||
fi
|
||||
if [ "${should_install_from_source}" = "true" ]; then
|
||||
install_from_source
|
||||
fi
|
||||
updaterc "if [[ \"\${PATH}\" != *\"${PYTHON_INSTALL_PATH}/bin\"* ]]; then export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}; fi"
|
||||
fi
|
||||
|
||||
# If not installing python tools, exit
|
||||
if [ "${INSTALL_PYTHON_TOOLS}" != "true" ]; then
|
||||
echo "Done!"
|
||||
exit 0;
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEFAULT_UTILS="\
|
||||
pylint \
|
||||
flake8 \
|
||||
autopep8 \
|
||||
black \
|
||||
yapf \
|
||||
mypy \
|
||||
pydocstyle \
|
||||
pycodestyle \
|
||||
bandit \
|
||||
pipenv \
|
||||
virtualenv"
|
||||
|
||||
export PIPX_BIN_DIR=${PIPX_HOME}/bin
|
||||
export PATH=${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
python3 -m pip install --no-cache-dir --upgrade pip
|
||||
export PIPX_BIN_DIR="${PIPX_HOME}/bin"
|
||||
export PATH="${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}"
|
||||
|
||||
# Create pipx group, dir, and set sticky bit
|
||||
if ! cat /etc/group | grep -e "^pipx:" > /dev/null 2>&1; then
|
||||
|
@ -290,13 +310,27 @@ mkdir -p ${PIPX_BIN_DIR}
|
|||
chown :pipx ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
chmod g+s ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
${PYTHON_INSTALL_PATH}/bin/python3 -m pip install --no-cache-dir --upgrade pip
|
||||
|
||||
# Install tools
|
||||
echo "Installing Python tools..."
|
||||
export PYTHONUSERBASE=/tmp/pip-tmp
|
||||
export PIP_CACHE_DIR=/tmp/pip-tmp/cache
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/tmp/pip-tmp/bin/pipx install --pip-args=--no-cache-dir pipx
|
||||
echo "${DEFAULT_UTILS}" | xargs -n 1 /tmp/pip-tmp/bin/pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall'
|
||||
pipx_path=""
|
||||
if ! type pipx > /dev/null 2>&1; then
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/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
|
||||
if ! type ${util} > /dev/null 2>&1; then
|
||||
${pipx_path}pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' ${util}
|
||||
else
|
||||
echo "${util} already installed. Skipping."
|
||||
fi
|
||||
done
|
||||
rm -rf /tmp/pip-tmp
|
||||
|
||||
updaterc "$(cat << EOF
|
||||
|
|
1
containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
1
containers/python-3-pypy/.devcontainer/library-scripts/common-debian.sh
Normal file → Executable file
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
234
containers/python-3/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
234
containers/python-3/.devcontainer/library-scripts/python-debian.sh
Normal file → Executable file
|
@ -7,7 +7,7 @@
|
|||
# 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]
|
||||
# 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"}
|
||||
PYTHON_INSTALL_PATH=${2:-"/usr/local/python"}
|
||||
|
@ -15,9 +15,10 @@ export PIPX_HOME=${3:-"/usr/local/py-utils"}
|
|||
USERNAME=${4:-"automatic"}
|
||||
UPDATE_RC=${5:-"true"}
|
||||
INSTALL_PYTHON_TOOLS=${6:-"true"}
|
||||
USE_PPA_IF_AVAILABLE=${7:-"true"}
|
||||
USE_ORYX_IF_AVAILABLE=${7:-"true"}
|
||||
OPTIMIZE_BUILD_FROM_SOURCE=${8-"false"}
|
||||
|
||||
DEADSNAKES_PPA_ARCHIVE_GPG_KEY="F23C5A6CF475977595C89F51BA6932366A755776"
|
||||
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"
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
|
@ -55,8 +56,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -109,7 +112,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
@ -148,6 +151,44 @@ find_version_from_git_tags() {
|
|||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
# Use Oryx to install something using a partial version match
|
||||
oryx_install() {
|
||||
local platform=$1
|
||||
local requested_version=$2
|
||||
local target_folder=${3:-none}
|
||||
local ldconfig_folder=${4:-none}
|
||||
echo "(*) Installing ${platform} ${requested_version} using Oryx..."
|
||||
check_packages jq
|
||||
# Soft match if full version not specified
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local version_list="$(oryx platforms --json | jq -r ".[] | select(.Name == \"${platform}\") | .Versions | sort | reverse | @tsv" | tr '\t' '\n' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$')"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
requested_version="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
requested_version="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
if [ -z "${requested_version}" ] || ! echo "${version_list}" | grep "^${requested_version//./\\.}$" > /dev/null 2>&1; then
|
||||
echo -e "(!) Oryx does not support ${platform} version $2\nValid values:\n${version_list}" >&2
|
||||
return 1
|
||||
fi
|
||||
echo "(*) Using ${requested_version} in place of $2."
|
||||
fi
|
||||
|
||||
export ORYX_ENV_TYPE=vsonline-present ORYX_PREFER_USER_INSTALLED_SDKS=true ENABLE_DYNAMIC_INSTALL=true DYNAMIC_INSTALL_ROOT_DIR=/opt
|
||||
oryx prep --skip-detection --platforms-and-versions "${platform}=${requested_version}"
|
||||
local opt_folder="/opt/${platform}/${requested_version}"
|
||||
if [ "${target_folder}" != "none" ] && [ "${target_folder}" != "${opt_folder}" ]; then
|
||||
ln -s "${opt_folder}" "${target_folder}"
|
||||
fi
|
||||
# Update library path add to conf
|
||||
if [ "${ldconfig_folder}" != "none" ]; then
|
||||
echo "/opt/${platform}/${requested_version}/lib" >> "/etc/ld.so.conf.d/${platform}.conf"
|
||||
ldconfig
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run apt-get if needed
|
||||
apt_get_update_if_needed()
|
||||
{
|
||||
|
@ -167,76 +208,71 @@ check_packages() {
|
|||
fi
|
||||
}
|
||||
|
||||
install_from_ppa() {
|
||||
local requested_version="python${PYTHON_VERSION}"
|
||||
echo "Using PPA to install Python..."
|
||||
check_packages apt-transport-https curl ca-certificates gnupg2
|
||||
receive_gpg_keys DEADSNAKES_PPA_ARCHIVE_GPG_KEY /usr/share/keyrings/deadsnakes-archive-keyring.gpg
|
||||
echo -e "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpad.net/deadsnakes/ppa/ubuntu ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/deadsnakes-ppa.list
|
||||
apt-get update
|
||||
if [ "${PYTHON_VERSION}" = "latest" ] || [ "${PYTHON_VERSION}" = "current" ] || [ "${PYTHON_VERSION}" = "lts" ]; then
|
||||
requested_version="$(apt-cache search '^python3\.[0-9]$' | grep -oE '^python3\.[0-9]' | sort -rV | head -n 1)"
|
||||
echo "Using ${requested_version} in place of ${PYTHON_VERSION}."
|
||||
fi
|
||||
apt-get -y install ${requested_version}
|
||||
rm -rf /tmp/tmp-gnupg
|
||||
exit 0
|
||||
}
|
||||
|
||||
install_from_source() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
else
|
||||
echo "Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates tar make build-essential libssl-dev zlib1g-dev \
|
||||
wget libbz2-dev libreadline-dev libxml2-dev xz-utils tk-dev gnupg2 \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev llvm dirmngr
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
TGZ_FILENAME="Python-${PYTHON_VERSION}.tgz"
|
||||
TGZ_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/${TGZ_FILENAME}"
|
||||
echo "Downloading ${TGZ_FILENAME}..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}" "${TGZ_URL}"
|
||||
|
||||
# Verify signature
|
||||
if [ "${SKIP_SIGNATURE_CHECK}" != "true" ]; then
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${TGZ_FILENAME}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${TGZ_FILENAME}.asc" "${TGZ_URL}.asc"
|
||||
gpg --verify "${TGZ_FILENAME}.asc"
|
||||
fi
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${TGZ_FILENAME}" -C "/tmp/python-src" --strip-components=1
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --enable-optimizations --with-ensurepip=install
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
updaterc "export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}"
|
||||
fi
|
||||
echo "(*) Building Python ${PYTHON_VERSION} from source..."
|
||||
# Install prereqs if missing
|
||||
check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \
|
||||
libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \
|
||||
libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Find version using soft match
|
||||
find_version_from_git_tags PYTHON_VERSION "https://github.com/python/cpython"
|
||||
|
||||
# Download tgz of source
|
||||
mkdir -p /tmp/python-src "${PYTHON_INSTALL_PATH}"
|
||||
cd /tmp/python-src
|
||||
local tgz_filename="Python-${PYTHON_VERSION}.tgz"
|
||||
local tgz_url="https://www.python.org/ftp/python/${PYTHON_VERSION}/${tgz_filename}"
|
||||
echo "Downloading ${tgz_filename}..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}" "${tgz_url}"
|
||||
|
||||
# Verify signature
|
||||
receive_gpg_keys PYTHON_SOURCE_GPG_KEYS
|
||||
echo "Downloading ${tgz_filename}.asc..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}.asc" "${tgz_url}.asc"
|
||||
gpg --verify "${tgz_filename}.asc"
|
||||
|
||||
# Update min protocol for testing only - https://bugs.python.org/issue41561
|
||||
cp /etc/ssl/openssl.cnf /tmp/python-src/
|
||||
sed -i -E 's/MinProtocol[=\ ]+.*/MinProtocol = TLSv1.0/g' /tmp/python-src/openssl.cnf
|
||||
export OPENSSL_CONF=/tmp/python-src/openssl.cnf
|
||||
|
||||
# Untar and build
|
||||
tar -xzf "/tmp/python-src/${tgz_filename}" -C "/tmp/python-src" --strip-components=1
|
||||
local config_args=""
|
||||
if [ "${OPTIMIZE_BUILD_FROM_SOURCE}" = "true" ]; then
|
||||
config_args="--enable-optimizations"
|
||||
fi
|
||||
./configure --prefix="${PYTHON_INSTALL_PATH}" --with-ensurepip=install ${config_args}
|
||||
make -j 8
|
||||
make install
|
||||
cd /tmp
|
||||
rm -rf /tmp/python-src ${GNUPGHOME} /tmp/vscdc-settings.env
|
||||
chown -R ${USERNAME} "${PYTHON_INSTALL_PATH}"
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3 ${PYTHON_INSTALL_PATH}/bin/python
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pip3 ${PYTHON_INSTALL_PATH}/bin/pip
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
install_using_oryx() {
|
||||
if [ -d "${PYTHON_INSTALL_PATH}" ]; then
|
||||
echo "(!) Path ${PYTHON_INSTALL_PATH} already exists. Remove this existing path or select a different one."
|
||||
exit 1
|
||||
fi
|
||||
oryx_install "python" "${PYTHON_VERSION}" "${PYTHON_INSTALL_PATH}" "lib" || return 1
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/idle3 ${PYTHON_INSTALL_PATH}/bin/idle
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/pydoc3 ${PYTHON_INSTALL_PATH}/bin/pydoc
|
||||
ln -s ${PYTHON_INSTALL_PATH}/bin/python3-config ${PYTHON_INSTALL_PATH}/bin/python-config
|
||||
}
|
||||
|
||||
# Ensure apt is in non-interactive to avoid prompts
|
||||
|
@ -244,41 +280,25 @@ export DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
# Install python from source if needed
|
||||
if [ "${PYTHON_VERSION}" != "none" ]; then
|
||||
# Source /etc/os-release to get OS info
|
||||
. /etc/os-release
|
||||
# If ubuntu, PPAs allowed - install from there
|
||||
if [ "${ID}" = "ubuntu" ] && [ "${USE_PPA_IF_AVAILABLE}" = "true" ]; then
|
||||
install_from_ppa
|
||||
if [ "$(dpkg --print-architecture)" = "amd64" ] && [ "${USE_ORYX_IF_AVAILABLE}" = "true" ] && type oryx > /dev/null 2>&1; then
|
||||
install_using_oryx || should_install_from_source=true
|
||||
else
|
||||
should_install_from_source=true
|
||||
fi
|
||||
if [ "${should_install_from_source}" = "true" ]; then
|
||||
install_from_source
|
||||
fi
|
||||
updaterc "if [[ \"\${PATH}\" != *\"${PYTHON_INSTALL_PATH}/bin\"* ]]; then export PATH=${PYTHON_INSTALL_PATH}/bin:\${PATH}; fi"
|
||||
fi
|
||||
|
||||
# If not installing python tools, exit
|
||||
if [ "${INSTALL_PYTHON_TOOLS}" != "true" ]; then
|
||||
echo "Done!"
|
||||
exit 0;
|
||||
exit 0
|
||||
fi
|
||||
|
||||
DEFAULT_UTILS="\
|
||||
pylint \
|
||||
flake8 \
|
||||
autopep8 \
|
||||
black \
|
||||
yapf \
|
||||
mypy \
|
||||
pydocstyle \
|
||||
pycodestyle \
|
||||
bandit \
|
||||
pipenv \
|
||||
virtualenv"
|
||||
|
||||
export PIPX_BIN_DIR=${PIPX_HOME}/bin
|
||||
export PATH=${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
python3 -m pip install --no-cache-dir --upgrade pip
|
||||
export PIPX_BIN_DIR="${PIPX_HOME}/bin"
|
||||
export PATH="${PYTHON_INSTALL_PATH}/bin:${PIPX_BIN_DIR}:${PATH}"
|
||||
|
||||
# Create pipx group, dir, and set sticky bit
|
||||
if ! cat /etc/group | grep -e "^pipx:" > /dev/null 2>&1; then
|
||||
|
@ -290,13 +310,27 @@ mkdir -p ${PIPX_BIN_DIR}
|
|||
chown :pipx ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
chmod g+s ${PIPX_HOME} ${PIPX_BIN_DIR}
|
||||
|
||||
# Update pip
|
||||
echo "Updating pip..."
|
||||
${PYTHON_INSTALL_PATH}/bin/python3 -m pip install --no-cache-dir --upgrade pip
|
||||
|
||||
# Install tools
|
||||
echo "Installing Python tools..."
|
||||
export PYTHONUSERBASE=/tmp/pip-tmp
|
||||
export PIP_CACHE_DIR=/tmp/pip-tmp/cache
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/tmp/pip-tmp/bin/pipx install --pip-args=--no-cache-dir pipx
|
||||
echo "${DEFAULT_UTILS}" | xargs -n 1 /tmp/pip-tmp/bin/pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall'
|
||||
pipx_path=""
|
||||
if ! type pipx > /dev/null 2>&1; then
|
||||
pip3 install --disable-pip-version-check --no-warn-script-location --no-cache-dir --user pipx
|
||||
/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
|
||||
if ! type ${util} > /dev/null 2>&1; then
|
||||
${pipx_path}pipx install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' ${util}
|
||||
else
|
||||
echo "${util} already installed. Skipping."
|
||||
fi
|
||||
done
|
||||
rm -rf /tmp/pip-tmp
|
||||
|
||||
updaterc "$(cat << EOF
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
|
@ -52,8 +52,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -105,7 +107,7 @@ receive_gpg_keys() {
|
|||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to install rvm."
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -47,8 +47,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
|
@ -48,8 +48,10 @@ fi
|
|||
updaterc() {
|
||||
if [ "${UPDATE_RC}" = "true" ]; then
|
||||
echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..."
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
if [ -f "/etc/zsh/zshrc" ]; then
|
||||
if [[ "$(cat /etc/bash.bashrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/bash.bashrc
|
||||
fi
|
||||
if [ -f "/etc/zsh/zshrc" ] && [[ "$(cat /etc/zsh/zshrc)" != *"$1"* ]]; then
|
||||
echo -e "$1" >> /etc/zsh/zshrc
|
||||
fi
|
||||
fi
|
||||
|
@ -78,7 +80,7 @@ check_packages() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install dependencies
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2
|
||||
check_packages apt-transport-https curl ca-certificates tar gnupg2 dirmngr
|
||||
|
||||
# Install yarn
|
||||
if type yarn > /dev/null 2>&1; then
|
||||
|
|
|
@ -78,6 +78,7 @@ if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
|||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
|
|
2
repository-containers/images/github.com/microsoft/vscode/.devcontainer/library-scripts/desktop-lite-debian.sh
Normal file → Executable file
2
repository-containers/images/github.com/microsoft/vscode/.devcontainer/library-scripts/desktop-lite-debian.sh
Normal file → Executable file
|
@ -14,7 +14,7 @@ VNC_PASSWORD=${2:-"vscode"}
|
|||
INSTALL_NOVNC=${3:-"true"}
|
||||
|
||||
NOVNC_VERSION=1.2.0
|
||||
WEBSOCKETIFY_VERSION=0.9.0
|
||||
WEBSOCKETIFY_VERSION=0.10.0
|
||||
|
||||
package_list="
|
||||
tigervnc-standalone-server \
|
||||
|
|
Загрузка…
Ссылка в новой задаче