Skip to content

Commit b865ebb

Browse files
authored
Merge branch 'main' into Azure_linux3_CU
2 parents 10d52e9 + 87befbc commit b865ebb

22 files changed

Lines changed: 393 additions & 93 deletions

src/aws-cli/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ check_packages() {
6868

6969
export DEBIAN_FRONTEND=noninteractive
7070

71-
check_packages curl ca-certificates gnupg2 dirmngr unzip bash-completion
71+
check_packages curl ca-certificates gnupg2 dirmngr unzip bash-completion less
7272

7373
verify_aws_cli_gpg_signature() {
7474
local filePath=$1

src/azure-cli/devcontainer-feature.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "azure-cli",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"name": "Azure CLI",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/azure-cli",
66
"description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
@@ -23,6 +23,14 @@
2323
"description": "Optionally install Azure Bicep",
2424
"default": false
2525
},
26+
"bicepVersion": {
27+
"type": "string",
28+
"proposals": [
29+
"latest"
30+
],
31+
"default": "latest",
32+
"description": "Select or enter a Bicep version. ('latest' or a specic version such as 'v0.31.92')"
33+
},
2634
"installUsingPython": {
2735
"type": "boolean",
2836
"description": "Install Azure CLI using Python instead of pipx",

src/azure-cli/install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ rm -rf /var/lib/apt/lists/*
1515
AZ_VERSION=${VERSION:-"latest"}
1616
AZ_EXTENSIONS=${EXTENSIONS}
1717
AZ_INSTALLBICEP=${INSTALLBICEP:-false}
18+
AZ_BICEPVERSION=${BICEPVERSION:-latest}
1819
INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false}
1920
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
2021
AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64"
@@ -229,10 +230,16 @@ if [ "${AZ_INSTALLBICEP}" = "true" ]; then
229230
# The `az bicep install --target-platform` could be a solution; however, linux-arm64 is not an allowed value for this argument yet
230231
# Manually installing Bicep and moving to the appropriate directory where az expects it to be
231232

233+
if [ "${AZ_BICEPVERSION}" = "latest" ]; then
234+
bicep_download_path="https://github.com/Azure/bicep/releases/latest/download"
235+
else
236+
bicep_download_path="https://github.com/Azure/bicep/releases/download/${AZ_BICEPVERSION}"
237+
fi
238+
232239
if [ "${architecture}" = "arm64" ]; then
233-
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-arm64
240+
curl -Lo bicep ${bicep_download_path}/bicep-linux-arm64
234241
else
235-
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
242+
curl -Lo bicep ${bicep_download_path}/bicep-linux-x64
236243
fi
237244

238245
chmod +x ./bicep

src/docker-in-docker/devcontainer-feature.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-in-docker",
3-
"version": "2.12.0",
3+
"version": "2.12.1",
44
"name": "Docker (Docker-in-Docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
66
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",
@@ -29,11 +29,11 @@
2929
"type": "string",
3030
"enum": [
3131
"none",
32-
"latest",
32+
"v1",
3333
"v2"
3434
],
35-
"default": "latest",
36-
"description": "Default version of Docker Compose (latest, v2 or none)"
35+
"default": "v2",
36+
"description": "Default version of Docker Compose (v1, v2 or none)"
3737
},
3838
"azureDnsAutoDetection": {
3939
"type": "boolean",

src/docker-in-docker/install.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DOCKER_VERSION="${VERSION:-"latest"}" # The Docker/Moby Engine + CLI should match in version
1212
USE_MOBY="${MOBY:-"true"}"
1313
MOBY_BUILDX_VERSION="${MOBYBUILDXVERSION:-"latest"}"
14-
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"latest"}" #latest, v2 or none
14+
DOCKER_DASH_COMPOSE_VERSION="${DOCKERDASHCOMPOSEVERSION:-"v2"}" #v1, v2 or none
1515
AZURE_DNS_AUTO_DETECTION="${AZUREDNSAUTODETECTION:-"true"}"
1616
DOCKER_DEFAULT_ADDRESS_POOL="${DOCKERDEFAULTADDRESSPOOL:-""}"
1717
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
@@ -157,26 +157,28 @@ get_previous_version() {
157157
local repo_url=$2
158158
local variable_name=$3
159159
prev_version=${!variable_name}
160-
160+
161161
output=$(curl -s "$repo_url");
162-
message=$(echo "$output" | jq -r '.message')
163-
164-
if [[ $message == "API rate limit exceeded"* ]]; then
165-
echo -e "\nAn attempt to find latest version using GitHub Api Failed... \nReason: ${message}"
166-
echo -e "\nAttempting to find latest version using GitHub tags."
167-
find_prev_version_from_git_tags prev_version "$url" "tags/v"
168-
declare -g ${variable_name}="${prev_version}"
169-
else
162+
if echo "$output" | jq -e 'type == "object"' > /dev/null; then
163+
message=$(echo "$output" | jq -r '.message')
164+
165+
if [[ $message == "API rate limit exceeded"* ]]; then
166+
echo -e "\nAn attempt to find latest version using GitHub Api Failed... \nReason: ${message}"
167+
echo -e "\nAttempting to find latest version using GitHub tags."
168+
find_prev_version_from_git_tags prev_version "$url" "tags/v"
169+
declare -g ${variable_name}="${prev_version}"
170+
fi
171+
elif echo "$output" | jq -e 'type == "array"' > /dev/null; then
170172
echo -e "\nAttempting to find latest version using GitHub Api."
171-
version=$(echo "$output" | jq -r '.tag_name')
173+
version=$(echo "$output" | jq -r '.[1].tag_name')
172174
declare -g ${variable_name}="${version#v}"
173175
fi
174176
echo "${variable_name}=${!variable_name}"
175177
}
176178

177179
get_github_api_repo_url() {
178180
local url=$1
179-
echo "${url/https:\/\/github.com/https:\/\/api.github.com\/repos}/releases/latest"
181+
echo "${url/https:\/\/github.com/https:\/\/api.github.com\/repos}/releases"
180182
}
181183

182184
###########################################
@@ -312,6 +314,7 @@ else
312314
else
313315
apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix}
314316
# Install compose
317+
apt-mark hold docker-ce docker-ce-cli
315318
apt-get -y install --no-install-recommends docker-compose-plugin || echo "(*) Package docker-compose-plugin (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping."
316319
fi
317320
fi
@@ -371,11 +374,8 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then
371374
find_version_from_git_tags compose_version "$docker_compose_url" "tags/v"
372375
echo "(*) Installing docker-compose ${compose_version}..."
373376
curl -fsSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path} || {
374-
if [[ $DOCKER_DASH_COMPOSE_VERSION == "latest" ]]; then
375-
fallback_compose "$docker_compose_url"
376-
else
377-
echo -e "Error: Failed to install docker-compose v${compose_version}"
378-
fi
377+
echo -e "\n(!) Failed to fetch the latest artifacts for docker-compose v${compose_version}..."
378+
fallback_compose "$docker_compose_url"
379379
}
380380

381381
chmod +x ${docker_compose_path}

src/docker-outside-of-docker/devcontainer-feature.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-outside-of-docker",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"name": "Docker (docker-outside-of-docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker",
66
"description": "Re-use the host docker socket, adding the Docker CLI to a container. Feature invokes a script to enable using a forwarded Docker socket within a container to run Docker commands.",
@@ -61,6 +61,9 @@
6161
"type": "bind"
6262
}
6363
],
64+
"securityOpt": [
65+
"label=disable"
66+
],
6467
"installsAfter": [
6568
"ghcr.io/devcontainers/features/common-utils"
6669
],

src/docker-outside-of-docker/install.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,26 @@ get_previous_version() {
156156
output=$(curl -s "$repo_url");
157157

158158
check_packages jq
159-
160-
message=$(echo "$output" | jq -r '.message')
161159

162-
if [[ $message == "API rate limit exceeded"* ]]; then
163-
echo -e "\nAn attempt to find latest version using GitHub Api Failed... \nReason: ${message}"
164-
echo -e "\nAttempting to find latest version using GitHub tags."
165-
find_prev_version_from_git_tags prev_version "$url" "tags/v"
166-
declare -g ${variable_name}="${prev_version}"
167-
else
168-
echo -e "\nAttempting to find latest version using GitHub Api."
169-
version=$(echo "$output" | jq -r '.tag_name')
160+
if echo "$output" | jq -e 'type == "object"' > /dev/null; then
161+
message=$(echo "$output" | jq -r '.message')
162+
if [[ $message == "API rate limit exceeded"* ]]; then
163+
echo -e "\nAn attempt to find previous to latest version using GitHub Api Failed... \nReason: ${message}"
164+
echo -e "\nAttempting to find previous to latest version using GitHub tags."
165+
find_prev_version_from_git_tags prev_version "$url" "tags/v"
166+
declare -g ${variable_name}="${prev_version}"
167+
fi
168+
elif echo "$output" | jq -e 'type == "array"' > /dev/null; then
169+
echo -e "\nAttempting to find previous version using GitHub Api."
170+
version=$(echo "$output" | jq -r '.[1].tag_name')
170171
declare -g ${variable_name}="${version#v}"
171172
fi
172-
echo "${variable_name}=${!variable_name}"
173+
echo "${variable_name}=${!variable_name}"
173174
}
174175

175176
get_github_api_repo_url() {
176177
local url=$1
177-
echo "${url/https:\/\/github.com/https:\/\/api.github.com\/repos}/releases/latest"
178+
echo "${url/https:\/\/github.com/https:\/\/api.github.com\/repos}/releases"
178179
}
179180

180181
install_compose_switch_fallback() {
@@ -361,11 +362,7 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then
361362
find_version_from_git_tags compose_version "$docker_compose_url" "tags/v"
362363
echo "(*) Installing docker-compose ${compose_version}..."
363364
curl -fsSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path} || {
364-
if [[ $DOCKER_DASH_COMPOSE_VERSION == "latest" ]]; then
365-
install_compose_fallback "$docker_compose_url" "$compose_version" "$target_compose_arch" "$docker_compose_path"
366-
else
367-
echo -e "Error: Failed to install docker-compose v${compose_version}"
368-
fi
365+
install_compose_fallback "$docker_compose_url" "$compose_version" "$target_compose_arch" "$docker_compose_path"
369366
}
370367
chmod +x ${docker_compose_path}
371368

src/nvidia-cuda/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ if [ "$CUDNN_VERSION" = "automatic" ]; then
7474
if [[ "$CUDA_VERSION" < "12.3" ]]; then
7575
CUDNN_VERSION=$(apt-cache policy libcudnn8 | grep "$CUDA_VERSION" | grep -Eo '^[^-1+]*' | sort -V | tail -n1 | xargs)
7676
else
77-
CUDNN_VERSION=$(apt-cache policy libcudnn9-cuda-$major_cuda_version | grep "Candidate" | awk '{print $2}' | grep -Eo '^[^-1+]*')
77+
CUDNN_VERSION=$(apt-cache policy libcudnn9-cuda-$major_cuda_version | grep "Candidate" | awk '{print $2}' | grep -Eo '^[^-+]*')
7878
fi
7979
fi
8080
major_cudnn_version=$(echo "${CUDNN_VERSION}" | cut -d '.' -f 1)

src/python/install.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,15 +766,19 @@ esac
766766

767767
check_packages ${REQUIRED_PKGS}
768768

769+
# Function to get the major version from a SemVer string
770+
get_major_version() {
771+
local version="$1"
772+
echo "$version" | cut -d '.' -f 1
773+
}
774+
769775
# Install Python from source if needed
770776
if [ "${PYTHON_VERSION}" != "none" ]; then
771777
if ! cat /etc/group | grep -e "^python:" > /dev/null 2>&1; then
772778
groupadd -r python
773779
fi
774780
usermod -a -G python "${USERNAME}"
775-
776781
CURRENT_PATH="${PYTHON_INSTALL_PATH}/current"
777-
778782
install_python ${PYTHON_VERSION}
779783

780784
# Additional python versions to be installed but not be set as default.
@@ -783,9 +787,27 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
783787
OLDIFS=$IFS
784788
IFS=","
785789
read -a additional_versions <<< "$ADDITIONAL_VERSIONS"
786-
for version in "${additional_versions[@]}"; do
790+
major_version=$(get_major_version ${VERSION})
791+
if type apt-get > /dev/null 2>&1; then
792+
# Debian/Ubuntu: Use update-alternatives
793+
update-alternatives --install ${CURRENT_PATH} python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION} $((${#additional_versions[@]}+1))
794+
update-alternatives --set python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION}
795+
elif type dnf > /dev/null 2>&1 || type yum > /dev/null 2>&1 || type microdnf > /dev/null 2>&1; then
796+
# Fedora/RHEL/CentOS: Use alternatives
797+
alternatives --install ${CURRENT_PATH} python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION} $((${#additional_versions[@]}+1))
798+
alternatives --set python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION}
799+
fi
800+
for i in "${!additional_versions[@]}"; do
801+
version=${additional_versions[$i]}
787802
OVERRIDE_DEFAULT_VERSION="false"
788803
install_python $version
804+
if type apt-get > /dev/null 2>&1; then
805+
# Debian/Ubuntu: Use update-alternatives
806+
update-alternatives --install ${CURRENT_PATH} python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION} $((${i}+1))
807+
elif type dnf > /dev/null 2>&1 || type yum > /dev/null 2>&1 || type microdnf > /dev/null 2>&1; then
808+
# Fedora/RHEL/CentOS: Use alternatives
809+
alternatives --install ${CURRENT_PATH} python${major_version} ${PYTHON_INSTALL_PATH}/${VERSION} $((${i}+1))
810+
fi
789811
done
790812
INSTALL_PATH="${OLD_INSTALL_PATH}"
791813
IFS=$OLDIFS

src/terraform/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ Installs the Terraform CLI and optionally TFLint and Terragrunt. Auto-detects la
2828
### VS Code Extensions
2929

3030
- `HashiCorp.terraform`
31-
- `ms-azuretools.vscode-azureterraform`
32-
33-
3431

3532
## Licensing
3633

0 commit comments

Comments
 (0)