Skip to content

Commit c9f00d1

Browse files
Merge branch 'main' into pwsh_alma_linux9
2 parents c5613be + c264b4e commit c9f00d1

18 files changed

Lines changed: 327 additions & 19 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/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ else
312312
else
313313
apt-get -y install --no-install-recommends docker-ce-cli${cli_version_suffix} docker-ce${engine_version_suffix}
314314
# Install compose
315+
apt-mark hold docker-ce docker-ce-cli
315316
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."
316317
fi
317318
fi

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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/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

src/terraform/devcontainer-feature.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@
5959
"customizations": {
6060
"vscode": {
6161
"extensions": [
62-
"HashiCorp.terraform",
63-
"ms-azuretools.vscode-azureterraform"
62+
"HashiCorp.terraform"
6463
],
6564
"settings": {
6665
"terraform.languageServer.enable": true,
6766
"terraform.languageServer.args": [
6867
"serve"
69-
],
70-
"azureTerraform.terminal": "integrated"
68+
]
7169
}
7270
}
7371
},

test/aws-cli/less_installed.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library for `check` command
6+
source dev-container-features-test-lib
7+
8+
check "less is installed, pagination works !" less --version
9+
check "less binary installation path" which less
10+
check "Testing paginated output with less" ls -R / | less
11+
12+
# Report result
13+
reportResults

0 commit comments

Comments
 (0)