Skip to content

Commit d4ecc7b

Browse files
Update Features - Remove use of get_common_setting (#735)
1 parent 719901a commit d4ecc7b

File tree

13 files changed

+16
-120
lines changed

13 files changed

+16
-120
lines changed
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
2-
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18",
3-
"remoteUser": "node",
4-
"customizations": {
5-
"vscode": {
6-
"extensions": [
7-
"mads-hartmann.bash-ide-vscode"
8-
]
9-
}
10-
},
2+
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-18",
113
"features": {
124
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
135
},
146
"postCreateCommand": "npm install -g @devcontainers/cli",
157
"hostRequirements": {
168
"cpus": 4
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"mads-hartmann.bash-ide-vscode"
14+
]
15+
}
1716
}
1817
}

src/aws-cli/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "aws-cli",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"name": "AWS CLI",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/aws-cli",
66
"description": "Installs the AWS CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",

src/aws-cli/install.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,6 @@ if [ "$(id -u)" -ne 0 ]; then
5050
exit 1
5151
fi
5252

53-
# Get central common setting
54-
get_common_setting() {
55-
if [ "${common_settings_file_loaded}" != "true" ]; then
56-
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" 2>/dev/null -o /tmp/vsdc-settings.env || echo "Could not download settings file. Skipping."
57-
common_settings_file_loaded=true
58-
fi
59-
if [ -f "/tmp/vsdc-settings.env" ]; then
60-
local multi_line=""
61-
if [ "$2" = "true" ]; then multi_line="-z"; fi
62-
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
63-
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
64-
fi
65-
echo "$1=${!1}"
66-
}
67-
6853
apt_get_update()
6954
{
7055
echo "Running apt-get update..."
@@ -89,9 +74,6 @@ check_packages curl ca-certificates gnupg2 dirmngr unzip
8974
verify_aws_cli_gpg_signature() {
9075
local filePath=$1
9176
local sigFilePath=$2
92-
93-
get_common_setting AWSCLI_GPG_KEY
94-
get_common_setting AWSCLI_GPG_KEY_MATERIAL true
9577
local awsGpgKeyring=aws-cli-public-key.gpg
9678

9779
echo "${AWSCLI_GPG_KEY_MATERIAL}" | gpg --dearmor > "./${awsGpgKeyring}"

src/azure-cli/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "azure-cli",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
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.",

src/azure-cli/install.sh

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,6 @@ fi
3232

3333
echo "Effective REMOTE_USER: ${_REMOTE_USER}"
3434

35-
# Get central common setting
36-
get_common_setting() {
37-
if [ "${common_settings_file_loaded}" != "true" ]; then
38-
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" 2>/dev/null -o /tmp/vsdc-settings.env || echo "Could not download settings file. Skipping."
39-
common_settings_file_loaded=true
40-
fi
41-
if [ -f "/tmp/vsdc-settings.env" ]; then
42-
local multi_line=""
43-
if [ "$2" = "true" ]; then multi_line="-z"; fi
44-
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
45-
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
46-
fi
47-
echo "$1=${!1}"
48-
}
49-
5035
apt_get_update()
5136
{
5237
echo "Running apt-get update..."
@@ -110,7 +95,6 @@ install_using_apt() {
11095
# Install dependencies
11196
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
11297
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
113-
get_common_setting MICROSOFT_GPG_KEYS_URI
11498
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
11599
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
116100
apt-get update

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-in-docker",
3-
"version": "2.7.0",
3+
"version": "2.7.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.",

src/docker-in-docker/install.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,6 @@ elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
5757
USERNAME=root
5858
fi
5959

60-
# Get central common setting
61-
get_common_setting() {
62-
if [ "${common_settings_file_loaded}" != "true" ]; then
63-
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" 2>/dev/null -o /tmp/vsdc-settings.env || echo "Could not download settings file. Skipping."
64-
common_settings_file_loaded=true
65-
fi
66-
if [ -f "/tmp/vsdc-settings.env" ]; then
67-
local multi_line=""
68-
if [ "$2" = "true" ]; then multi_line="-z"; fi
69-
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
70-
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
71-
fi
72-
echo "$1=${!1}"
73-
}
74-
7560
apt_get_update()
7661
{
7762
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
@@ -137,16 +122,13 @@ architecture="$(dpkg --print-architecture)"
137122

138123
# Check if distro is supported
139124
if [ "${USE_MOBY}" = "true" ]; then
140-
# 'get_common_setting' allows attribute to be updated remotely
141-
get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES
142125
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
143126
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution"
144127
err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
145128
exit 1
146129
fi
147130
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'"
148131
else
149-
get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES
150132
if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
151133
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution"
152134
err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
@@ -177,7 +159,6 @@ if [ "${USE_MOBY}" = "true" ]; then
177159
cli_package_name="moby-cli"
178160

179161
# Import key safely and import Microsoft apt repo
180-
get_common_setting MICROSOFT_GPG_KEYS_URI
181162
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
182163
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
183164
else

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "docker-outside-of-docker",
3-
"version": "1.3.0",
3+
"version": "1.3.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.",

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
1818
INSTALL_DOCKER_BUILDX="${INSTALLDOCKERBUILDX:-"true"}"
1919

2020
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
21-
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal jammy"
22-
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="buster bullseye bionic focal hirsute impish jammy"
21+
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal jammy"
22+
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal hirsute impish jammy"
2323

2424
set -e
2525

@@ -48,21 +48,6 @@ elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then
4848
USERNAME=root
4949
fi
5050

51-
# Get central common setting
52-
get_common_setting() {
53-
if [ "${common_settings_file_loaded}" != "true" ]; then
54-
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" 2>/dev/null -o /tmp/vsdc-settings.env || echo "Could not download settings file. Skipping."
55-
common_settings_file_loaded=true
56-
fi
57-
if [ -f "/tmp/vsdc-settings.env" ]; then
58-
local multi_line=""
59-
if [ "$2" = "true" ]; then multi_line="-z"; fi
60-
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
61-
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
62-
fi
63-
echo "$1=${!1}"
64-
}
65-
6651
apt_get_update()
6752
{
6853
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
@@ -129,16 +114,13 @@ architecture="$(dpkg --print-architecture)"
129114

130115
# Check if distro is supported
131116
if [ "${USE_MOBY}" = "true" ]; then
132-
# 'get_common_setting' allows attribute to be updated remotely
133-
get_common_setting DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES
134117
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
135118
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution"
136119
err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
137120
exit 1
138121
fi
139122
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'"
140123
else
141-
get_common_setting DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES
142124
if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
143125
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution"
144126
err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
@@ -153,7 +135,6 @@ if [ "${USE_MOBY}" = "true" ]; then
153135
cli_package_name="moby-cli"
154136

155137
# Import key safely and import Microsoft apt repo
156-
get_common_setting MICROSOFT_GPG_KEYS_URI
157138
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
158139
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
159140
else

src/go/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "go",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"name": "Go",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/go",
66
"description": "Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies.",

0 commit comments

Comments
 (0)