Skip to content

Commit 6c8bcea

Browse files
authored
Merge branch 'main' into fix/code_spell_1139
2 parents 5d36805 + efd8832 commit 6c8bcea

19 files changed

Lines changed: 163 additions & 99 deletions

src/common-utils/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "common-utils",
3-
"version": "2.5.2",
3+
"version": "2.5.3",
44
"name": "Common Utilities",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
66
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",

src/common-utils/install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ fi
3131
if [ "${ID}" = "alpine" ]; then
3232
apk add --no-cache bash
3333
fi
34-
34+
if [ "${ID}" = "azurelinux" ]; then
35+
tdnf install -y curl git
36+
fi
3537
exec /bin/bash "$(dirname $0)/main.sh" "$@"
3638
exit $?

src/common-utils/main.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,18 @@ install_redhat_packages() {
161161
local package_list=""
162162
local remove_epel="false"
163163
local install_cmd=microdnf
164-
if ! type microdnf > /dev/null 2>&1; then
165-
install_cmd=dnf
166-
if ! type dnf > /dev/null 2>&1; then
167-
install_cmd=yum
168-
fi
169-
fi
164+
if type microdnf > /dev/null 2>&1; then
165+
install_cmd=microdnf
166+
elif type tdnf > /dev/null 2>&1; then
167+
install_cmd=tdnf
168+
elif type dnf > /dev/null 2>&1; then
169+
install_cmd=dnf
170+
elif type yum > /dev/null 2>&1; then
171+
install_cmd=yum
172+
else
173+
echo "Unable to find 'tdnf', 'dnf', or 'yum' package manager. Exiting."
174+
exit 1
175+
fi
170176

171177
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
172178
package_list="${package_list} \
@@ -344,7 +350,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
344350
# Get an adjusted ID independent of distro variants
345351
if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
346352
ADJUSTED_ID="debian"
347-
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
353+
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "azurelinux" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
348354
ADJUSTED_ID="rhel"
349355
VERSION_CODENAME="${ID}${VERSION_ID}"
350356
elif [ "${ID}" = "alpine" ]; then

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

Lines changed: 12 additions & 5 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.2",
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",
@@ -71,7 +71,14 @@
7171
"vscode": {
7272
"extensions": [
7373
"ms-azuretools.vscode-docker"
74-
]
74+
],
75+
"settings": {
76+
"github.copilot.chat.codeGeneration.instructions": [
77+
{
78+
"text": "This dev container includes the Docker CLI (`docker`) pre-installed and available on the `PATH` for running and managing containers using a dedicated Docker daemon running inside the dev container."
79+
}
80+
]
81+
}
7582
}
7683
},
7784
"mounts": [

src/docker-in-docker/install.sh

Lines changed: 16 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
###########################################
@@ -372,11 +374,8 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then
372374
find_version_from_git_tags compose_version "$docker_compose_url" "tags/v"
373375
echo "(*) Installing docker-compose ${compose_version}..."
374376
curl -fsSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path} || {
375-
if [[ $DOCKER_DASH_COMPOSE_VERSION == "latest" ]]; then
376-
fallback_compose "$docker_compose_url"
377-
else
378-
echo -e "Error: Failed to install docker-compose v${compose_version}"
379-
fi
377+
echo -e "\n(!) Failed to fetch the latest artifacts for docker-compose v${compose_version}..."
378+
fallback_compose "$docker_compose_url"
380379
}
381380

382381
chmod +x ${docker_compose_path}

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-outside-of-docker",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"name": "Docker (docker-outside-of-docker)",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-outside-of-docker",
66
"description": "Reuse 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.",
@@ -51,7 +51,14 @@
5151
"vscode": {
5252
"extensions": [
5353
"ms-azuretools.vscode-docker"
54-
]
54+
],
55+
"settings": {
56+
"github.copilot.chat.codeGeneration.instructions": [
57+
{
58+
"text": "This dev container includes the Docker CLI (`docker`) pre-installed and available on the `PATH` for running and managing containers using the Docker daemon on the host machine."
59+
}
60+
]
61+
}
5562
}
5663
},
5764
"mounts": [

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/github-cli/devcontainer-feature.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "github-cli",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"name": "GitHub CLI",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/github-cli",
66
"description": "Installs the GitHub CLI. Auto-detects latest version and installs needed dependencies.",
@@ -19,6 +19,17 @@
1919
"default": true
2020
}
2121
},
22+
"customizations": {
23+
"vscode": {
24+
"settings": {
25+
"github.copilot.chat.codeGeneration.instructions": [
26+
{
27+
"text": "This dev container includes the GitHub CLI (`gh`), which is pre-installed and available on the `PATH`. IMPORTANT: `gh api -f` does not support object values, use multiple `-f` flags with hierarchical keys and string values instead. When using GitHub actions `actions/upload-artifact` or `actions/download-artifact` use v4 or later."
28+
}
29+
]
30+
}
31+
}
32+
},
2233
"installsAfter": [
2334
"ghcr.io/devcontainers/features/common-utils",
2435
"ghcr.io/devcontainers/features/git"

src/node/devcontainer-feature.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "node",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"name": "Node.js (via nvm), yarn and pnpm",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
66
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
@@ -61,7 +61,14 @@
6161
"vscode": {
6262
"extensions": [
6363
"dbaeumer.vscode-eslint"
64-
]
64+
],
65+
"settings": {
66+
"github.copilot.chat.codeGeneration.instructions": [
67+
{
68+
"text": "This dev container includes `node`, `npm` and `eslint` pre-installed and available on the `PATH` for Node.js and JavaScript development."
69+
}
70+
]
71+
}
6572
}
6673
},
6774
"containerEnv": {

src/python/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "python",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"name": "Python",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/python",
66
"description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",
@@ -77,6 +77,11 @@
7777
"ms-python.autopep8"
7878
],
7979
"settings": {
80+
"github.copilot.chat.codeGeneration.instructions": [
81+
{
82+
"text": "This dev container includes `python3` and `pip3` pre-installed and available on the `PATH`, along with the Python language extensions for Python development."
83+
}
84+
],
8085
"python.defaultInterpreterPath": "/usr/local/python/current/bin/python",
8186
"[python]": {
8287
"editor.defaultFormatter": "ms-python.autopep8"

0 commit comments

Comments
 (0)