Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9f58a6f
Initial plan
Copilot Apr 13, 2026
f24ac33
feat: add mirror overrides for feature download URLs
Copilot Apr 13, 2026
c2be3b6
chore: clean docker mirror variable initialization
Copilot Apr 13, 2026
b0a6037
fix: harden mirror string handling in ruby and java scripts
Copilot Apr 13, 2026
151d0a6
fix: address validation feedback in kubectl node ruby
Copilot Apr 13, 2026
7b5c864
fix: harden sdkman and ruby mirror config writes
Copilot Apr 13, 2026
8ae2156
fix: safely quote ruby mirror values in /etc/rvmrc
Copilot Apr 13, 2026
5459890
fix: validate RVM_INSTALL_MIRROR input for safe bootstrap
Copilot Apr 13, 2026
0f60769
Merge pull request #1 from bbartels/copilot/update-download-base-url-…
bbartels Apr 13, 2026
4832ef9
fix(powershell): restore aka.ms version resolution with resilient fal…
Copilot Apr 14, 2026
b88bf1b
chore(powershell): address validation feedback on fallback resolver
Copilot Apr 14, 2026
8e07b48
fix(powershell): harden version parsing and metadata fallback diagnos…
Copilot Apr 14, 2026
aa0d4dc
fix(powershell): handle metadata fetch failures correctly
Copilot Apr 14, 2026
fb764c5
fix: restore kubectl secondary fallback URL and simplify ruby rvmrc m…
Copilot Apr 14, 2026
a4b5d81
revert: restore powershell to upstream form, keeping only mirror URL …
Copilot Apr 14, 2026
c7a1359
feat: add minimal metadata.json fallback when aka.ms is unreachable
Copilot Apr 14, 2026
aa90fe7
Merge pull request #2 from bbartels/copilot/add-env-var-url-overrides
bbartels Apr 14, 2026
e8a08af
Apply suggestions from code review
bbartels Apr 14, 2026
76ca4ee
Apply suggestion from @bbartels
bbartels Apr 14, 2026
9aab57c
Apply suggestions from code review
bbartels Apr 14, 2026
0f7841c
Apply suggestion from @bbartels
bbartels Apr 14, 2026
f4fcf6e
Initial plan
Copilot Apr 14, 2026
eb0d354
chore: bump minor versions for mirror/keyserver feature updates
Copilot Apr 14, 2026
c9225b0
Merge pull request #3 from bbartels/copilot/bump-feature-versions
bbartels Apr 14, 2026
4c08900
Merge branch 'main' into main
bbartels Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/docker-in-docker/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "docker-in-docker",
"version": "2.16.1",
"version": "2.17.0",
"name": "Docker (Docker-in-Docker)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/docker-in-docker",
"description": "Create child containers *inside* a container, independent from the host's docker instance. Installs Docker extension in the container along with needed CLIs.",
Expand Down
43 changes: 23 additions & 20 deletions src/docker-in-docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ DOCKER_DEFAULT_ADDRESS_POOL="${DOCKERDEFAULTADDRESSPOOL:-""}"
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
INSTALL_DOCKER_BUILDX="${INSTALLDOCKERBUILDX:-"true"}"
INSTALL_DOCKER_COMPOSE_SWITCH="${INSTALLDOCKERCOMPOSESWITCH:-"false"}"
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
MICROSOFT_GPG_KEYS_ROLLING_URI="https://packages.microsoft.com/keys/microsoft-rolling.asc"
MICROSOFT_PACKAGES_MIRROR="${MICROSOFT_PACKAGES_MIRROR:-https://packages.microsoft.com}"
GITHUB_RELEASE_URL="${GITHUB_RELEASE_MIRROR:-https://github.com}"
DOCKER_MIRROR="${DOCKER_MIRROR:-https://download.docker.com}"
MICROSOFT_GPG_KEYS_URI="${MICROSOFT_PACKAGES_MIRROR}/keys/microsoft.asc"
MICROSOFT_GPG_KEYS_ROLLING_URI="${MICROSOFT_PACKAGES_MIRROR}/keys/microsoft-rolling.asc"
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal jammy noble"
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal hirsute impish jammy noble"
DISABLE_IP6_TABLES="${DISABLEIP6TABLES:-false}"
Expand Down Expand Up @@ -329,7 +332,7 @@ if [ "${USE_MOBY}" = "true" ]; then
curl -sSL ${MICROSOFT_GPG_KEYS_URI}
curl -sSL ${MICROSOFT_GPG_KEYS_ROLLING_URI}
} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
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
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] ${MICROSOFT_PACKAGES_MIRROR}/repos/microsoft-${ID}-${VERSION_CODENAME}-prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/microsoft.list
;;
rhel)
echo "(*) ${ID} detected - checking for Moby packages..."
Expand All @@ -353,7 +356,7 @@ if [ "${USE_MOBY}" = "true" ]; then
cat > /etc/yum.repos.d/microsoft.repo << EOF
[microsoft]
name=Microsoft Repository
baseurl=https://packages.microsoft.com/repos/microsoft-cbl-mariner-2.0-prod-base/
baseurl=${MICROSOFT_PACKAGES_MIRROR}/repos/microsoft-cbl-mariner-2.0-prod-base/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/microsoft.gpg
Expand Down Expand Up @@ -381,17 +384,17 @@ else
cli_package_name="docker-ce-cli"
case ${ADJUSTED_ID} in
debian)
curl -fsSL https://download.docker.com/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list
curl -fsSL ${DOCKER_MIRROR}/linux/${ID}/gpg | gpg --dearmor > /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] ${DOCKER_MIRROR}/linux/${ID} ${VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list
;;
rhel)
# Docker CE repository setup for RHEL-based systems
setup_docker_ce_repo() {
curl -fsSL https://download.docker.com/linux/centos/gpg > /etc/pki/rpm-gpg/docker-ce.gpg
curl -fsSL ${DOCKER_MIRROR}/linux/centos/gpg > /etc/pki/rpm-gpg/docker-ce.gpg
cat > /etc/yum.repos.d/docker-ce.repo << EOF
[docker-ce-stable]
name=Docker CE Stable
baseurl=https://download.docker.com/linux/centos/9/\$basearch/stable
baseurl=${DOCKER_MIRROR}/linux/centos/9/\$basearch/stable
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/docker-ce.gpg
Expand Down Expand Up @@ -436,9 +439,9 @@ EOF
*)
# Standard RHEL/CentOS/Fedora approach
if command -v dnf >/dev/null 2>&1; then
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf config-manager --add-repo ${DOCKER_MIRROR}/linux/centos/docker-ce.repo
elif command -v yum-config-manager >/dev/null 2>&1; then
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-repo ${DOCKER_MIRROR}/linux/centos/docker-ce.repo
else
# Manual fallback
setup_docker_ce_repo
Expand Down Expand Up @@ -608,7 +611,7 @@ else
echo "(*) Downloading Docker CE packages manually..."

# Get the repository baseurl
repo_baseurl="https://download.docker.com/linux/centos/9/x86_64/stable"
repo_baseurl="${DOCKER_MIRROR}/linux/centos/9/x86_64/stable"

# Download packages directly
cd /tmp/docker-ce-install
Expand Down Expand Up @@ -685,7 +688,7 @@ fallback_compose(){
echo -e "\n(!) Failed to fetch the latest artifacts for docker-compose v${compose_version}..."
get_previous_version "${url}" "${repo_url}" compose_version
echo -e "\nAttempting to install v${compose_version}"
curl -fsSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path}
curl -fsSL "${GITHUB_RELEASE_URL}/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path}
}

# If 'docker-compose' command is to be included
Expand All @@ -705,11 +708,11 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then

if [ "${target_compose_arch}" = "x86_64" ]; then
echo "(*) Installing docker compose v1..."
curl -fsSL "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" -o ${docker_compose_path}
curl -fsSL "${GITHUB_RELEASE_URL}/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64" -o ${docker_compose_path}
chmod +x ${docker_compose_path}

# Download the SHA256 checksum
DOCKER_COMPOSE_SHA256="$(curl -sSL "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64.sha256" | awk '{print $1}')"
DOCKER_COMPOSE_SHA256="$(curl -sSL "${GITHUB_RELEASE_URL}/docker/compose/releases/download/1.29.2/docker-compose-Linux-x86_64.sha256" | awk '{print $1}')"
echo "${DOCKER_COMPOSE_SHA256} ${docker_compose_path}" > docker-compose.sha256sum
sha256sum -c docker-compose.sha256sum --ignore-missing
elif [ "${VERSION_CODENAME}" = "bookworm" ]; then
Expand All @@ -727,15 +730,15 @@ if [ "${DOCKER_DASH_COMPOSE_VERSION}" != "none" ]; then
docker_compose_url="https://github.com/docker/compose"
find_version_from_git_tags compose_version "$docker_compose_url" "tags/v"
echo "(*) Installing docker-compose ${compose_version}..."
curl -fsSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path} || {
curl -fsSL "${GITHUB_RELEASE_URL}/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}" -o ${docker_compose_path} || {
echo -e "\n(!) Failed to fetch the latest artifacts for docker-compose v${compose_version}..."
fallback_compose "$docker_compose_url"
}

chmod +x ${docker_compose_path}

# Download the SHA256 checksum
DOCKER_COMPOSE_SHA256="$(curl -sSL "https://github.com/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}.sha256" | awk '{print $1}')"
DOCKER_COMPOSE_SHA256="$(curl -sSL "${GITHUB_RELEASE_URL}/docker/compose/releases/download/v${compose_version}/docker-compose-linux-${target_compose_arch}.sha256" | awk '{print $1}')"
echo "${DOCKER_COMPOSE_SHA256} ${docker_compose_path}" > docker-compose.sha256sum
sha256sum -c docker-compose.sha256sum --ignore-missing

Expand All @@ -751,7 +754,7 @@ fallback_compose-switch() {
echo -e "\n(!) Failed to fetch the latest artifacts for compose-switch v${compose_switch_version}..."
get_previous_version "$url" "$repo_url" compose_switch_version
echo -e "\nAttempting to install v${compose_switch_version}"
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${target_switch_arch}" -o /usr/local/bin/compose-switch
curl -fsSL "${GITHUB_RELEASE_URL}/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${target_switch_arch}" -o /usr/local/bin/compose-switch
}
# Install docker-compose switch if not already installed - https://github.com/docker/compose-switch#manual-installation
if [ "${INSTALL_DOCKER_COMPOSE_SWITCH}" = "true" ] && ! type compose-switch > /dev/null 2>&1; then
Expand All @@ -776,7 +779,7 @@ if [ "${INSTALL_DOCKER_COMPOSE_SWITCH}" = "true" ] && ! type compose-switch > /d
arm64|aarch64) target_switch_arch=arm64 ;;
*) target_switch_arch=${architecture} ;;
esac
curl -fsSL "https://github.com/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${target_switch_arch}" -o /usr/local/bin/compose-switch || fallback_compose-switch "$compose_switch_url"
curl -fsSL "${GITHUB_RELEASE_URL}/docker/compose-switch/releases/download/v${compose_switch_version}/docker-compose-linux-${target_switch_arch}" -o /usr/local/bin/compose-switch || fallback_compose-switch "$compose_switch_url"
chmod +x /usr/local/bin/compose-switch
# TODO: Verify checksum once available: https://github.com/docker/compose-switch/issues/11
# Setup v1 CLI as alternative in addition to compose-switch (which maps to v2)
Expand Down Expand Up @@ -811,7 +814,7 @@ fallback_buildx() {
get_previous_version "$url" "$repo_url" buildx_version
buildx_file_name="buildx-v${buildx_version}.linux-${target_buildx_arch}"
echo -e "\nAttempting to install v${buildx_version}"
wget https://github.com/docker/buildx/releases/download/v${buildx_version}/${buildx_file_name}
wget ${GITHUB_RELEASE_URL}/docker/buildx/releases/download/v${buildx_version}/${buildx_file_name}
}

if [ "${INSTALL_DOCKER_BUILDX}" = "true" ]; then
Expand All @@ -830,7 +833,7 @@ if [ "${INSTALL_DOCKER_BUILDX}" = "true" ]; then
buildx_file_name="buildx-v${buildx_version}.linux-${target_buildx_arch}"

cd /tmp
wget https://github.com/docker/buildx/releases/download/v${buildx_version}/${buildx_file_name} || fallback_buildx "$docker_buildx_url"
wget ${GITHUB_RELEASE_URL}/docker/buildx/releases/download/v${buildx_version}/${buildx_file_name} || fallback_buildx "$docker_buildx_url"

docker_home="/usr/libexec/docker"
cli_plugins_dir="${docker_home}/cli-plugins"
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "dotnet",
"version": "2.5.0",
"version": "2.6.0",
"name": "Dotnet CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/dotnet",
"description": "This Feature installs the latest .NET SDK, which includes the .NET CLI and the shared runtime. Options are provided to choose a different version or additional versions.",
Expand Down
10 changes: 8 additions & 2 deletions src/dotnet/scripts/dotnet-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Maintainer: The Dev Container spec maintainers
DOTNET_SCRIPTS=$(dirname "${BASH_SOURCE[0]}")
DOTNET_INSTALL_SCRIPT="$DOTNET_SCRIPTS/vendor/dotnet-install.sh"
DOTNET_RELEASES_INDEX_URL="https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json"
DOTNET_RELEASES_INDEX_URL="${DOTNET_RELEASES_MIRROR:-https://builds.dotnet.microsoft.com/dotnet}/release-metadata/releases-index.json"

# Prints the latest active dotnet version from the releases index.
# Usage: fetch_latest_version [<target>]
Expand Down Expand Up @@ -86,6 +86,9 @@ install_sdk() {
fi

local cmd=("$DOTNET_INSTALL_SCRIPT" "--version" "$version" "--install-dir" "$DOTNET_ROOT")
if [ -n "${DOTNET_RELEASES_MIRROR:-}" ]; then
cmd+=("--azure-feed" "${DOTNET_RELEASES_MIRROR}")
fi
if [ -n "$channel" ]; then
cmd+=("--channel" "$channel")
fi
Expand Down Expand Up @@ -125,6 +128,9 @@ install_runtime() {
fi

local cmd=("$DOTNET_INSTALL_SCRIPT" "--runtime" "$runtime" "--version" "$version" "--install-dir" "$DOTNET_ROOT" "--no-path")
if [ -n "${DOTNET_RELEASES_MIRROR:-}" ]; then
cmd+=("--azure-feed" "${DOTNET_RELEASES_MIRROR}")
fi
if [ -n "$channel" ]; then
cmd+=("--channel" "$channel")
fi
Expand Down Expand Up @@ -235,4 +241,4 @@ install_completions() {
# Fish: drop into the standard vendor completions directory
mkdir -p /usr/share/fish/vendor_completions.d
"$DOTNET_ROOT/dotnet" completions script fish > /usr/share/fish/vendor_completions.d/dotnet.fish
}
}
2 changes: 1 addition & 1 deletion src/github-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "github-cli",
"version": "1.1.0",
"version": "1.2.0",
"name": "GitHub CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/github-cli",
"description": "Installs the GitHub CLI. Auto-detects latest version and installs needed dependencies.",
Expand Down
10 changes: 8 additions & 2 deletions src/github-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
CLI_VERSION=${VERSION:-"latest"}
INSTALL_DIRECTLY_FROM_GITHUB_RELEASE=${INSTALLDIRECTLYFROMGITHUBRELEASE:-"true"}
EXTENSIONS=${EXTENSIONS:-""}
GITHUB_RELEASE_URL="${GITHUB_RELEASE_MIRROR:-https://github.com}"

GITHUB_CLI_ARCHIVE_GPG_KEY=23F3D4EA75716059

Expand All @@ -25,6 +26,11 @@ fi

# Get the list of GPG key servers that are reachable
get_gpg_key_servers() {
if [ -n "${GPG_KEYSERVER:-}" ]; then
echo "keyserver ${GPG_KEYSERVER}"
return
fi

declare -A keyservers_curl_map=(
["hkp://keyserver.ubuntu.com"]="http://keyserver.ubuntu.com:11371"
["hkp://keyserver.ubuntu.com:80"]="http://keyserver.ubuntu.com"
Expand Down Expand Up @@ -196,14 +202,14 @@ install_deb_using_github() {

mkdir -p /tmp/ghcli
pushd /tmp/ghcli
wget -q --show-progress --progress=dot:giga https://github.com/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
wget -q --show-progress --progress=dot:giga ${GITHUB_RELEASE_URL}/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
exit_code=$?
set -e
if [ "$exit_code" != "0" ]; then
# Handle situation where git tags are ahead of what was is available to actually download
echo "(!) github-cli version ${CLI_VERSION} failed to download. Attempting to fall back one version to retry..."
find_prev_version_from_git_tags CLI_VERSION https://github.com/cli/cli
wget -q --show-progress --progress=dot:giga https://github.com/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
wget -q --show-progress --progress=dot:giga ${GITHUB_RELEASE_URL}/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
fi

dpkg -i /tmp/ghcli/${cli_filename}
Expand Down
2 changes: 1 addition & 1 deletion src/go/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "go",
"version": "1.3.3",
"version": "1.4.0",
"name": "Go",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/go",
"description": "Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies.",
Expand Down
12 changes: 7 additions & 5 deletions src/go/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

TARGET_GO_VERSION="${VERSION:-"latest"}"
GOLANGCILINT_VERSION="${GOLANGCILINTVERSION:-"latest"}"
GO_MIRROR="${GO_MIRROR:-https://golang.org/dl}"
GO_TAG_SOURCE="${GO_TAG_SOURCE:-https://github.com/golang/go}"

TARGET_GOROOT="${TARGET_GOROOT:-"/usr/local/go"}"
TARGET_GOPATH="${TARGET_GOPATH:-"/go"}"
Expand Down Expand Up @@ -220,7 +222,7 @@ if ! [ -f /usr/bin/find ]; then
fi

# Get closest match for version number specified
find_version_from_git_tags TARGET_GO_VERSION "https://go.googlesource.com/go" "tags/go" "." "true"
find_version_from_git_tags TARGET_GO_VERSION "${GO_TAG_SOURCE}" "tags/go" "." "true"

architecture="$(uname -m)"
case $architecture in
Expand Down Expand Up @@ -248,7 +250,7 @@ if [[ "${TARGET_GO_VERSION}" != "none" ]] && [[ "$(go version 2>/dev/null)" != *
gpg -q --import /tmp/tmp-gnupg/golang_key
echo "Downloading Go ${TARGET_GO_VERSION}..."
set +e
curl -fsSL -o /tmp/go.tar.gz "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz"
curl -fsSL -o /tmp/go.tar.gz "${GO_MIRROR}/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz"
exit_code=$?
set -e
if [ "$exit_code" != "0" ]; then
Expand All @@ -263,7 +265,7 @@ if [[ "${TARGET_GO_VERSION}" != "none" ]] && [[ "$(go version 2>/dev/null)" != *
((minor=minor-1))
TARGET_GO_VERSION="${major}.${minor}"
# Look for latest version from previous minor release
find_version_from_git_tags TARGET_GO_VERSION "https://go.googlesource.com/go" "tags/go" "." "true"
find_version_from_git_tags TARGET_GO_VERSION "${GO_TAG_SOURCE}" "tags/go" "." "true"
else
((breakfix=breakfix-1))
if [ "${breakfix}" = "0" ]; then
Expand All @@ -274,9 +276,9 @@ if [[ "${TARGET_GO_VERSION}" != "none" ]] && [[ "$(go version 2>/dev/null)" != *
fi
set -e
echo "Trying ${TARGET_GO_VERSION}..."
curl -fsSL -o /tmp/go.tar.gz "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz"
curl -fsSL -o /tmp/go.tar.gz "${GO_MIRROR}/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz"
fi
curl -fsSL -o /tmp/go.tar.gz.asc "https://golang.org/dl/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz.asc"
curl -fsSL -o /tmp/go.tar.gz.asc "${GO_MIRROR}/go${TARGET_GO_VERSION}.linux-${architecture}.tar.gz.asc"
gpg --verify /tmp/go.tar.gz.asc /tmp/go.tar.gz
echo "Extracting Go ${TARGET_GO_VERSION}..."
tar -xzf /tmp/go.tar.gz -C "${TARGET_GOROOT}" --strip-components=1
Expand Down
2 changes: 1 addition & 1 deletion src/java/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "java",
"version": "1.8.0",
"version": "1.9.0",
"name": "Java (via SDKMAN!)",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/java",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
Expand Down
14 changes: 13 additions & 1 deletion src/java/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ANT_VERSION="${ANTVERSION:-"latest"}"
INSTALL_GROOVY="${INSTALLGROOVY:-"false"}"
GROOVY_VERSION="${GROOVYVERSION:-"latest"}"
JDK_DISTRO="${JDKDISTRO:-"ms"}"
ADOPTIUM_API_URL="${ADOPTIUM_MIRROR:-https://api.adoptium.net}"

export SDKMAN_DIR="${SDKMAN_DIR:-"/usr/local/sdkman"}"
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
Expand Down Expand Up @@ -204,7 +205,7 @@ find_version_list() {
java_ver=$6

check_packages jq
all_versions=$(curl -s https://api.adoptium.net/v3/info/available_releases)
all_versions=$(curl -s "${ADOPTIUM_API_URL}/v3/info/available_releases")
if [ "${ifLts}" = "true" ]; then
major_version=$(echo "$all_versions" | jq -r '.most_recent_lts')
elif [ "${java_ver}" = "latest" ]; then
Expand Down Expand Up @@ -324,6 +325,17 @@ if [ ! -d "${SDKMAN_DIR}" ]; then
export SDKMAN_NATIVE_VERSION="false"
fi
curl -sSL "https://get.sdkman.io?rcupdate=false" | bash
if [ -n "${SDKMAN_SERVICE_MIRROR:-}" ] && [ -f "${SDKMAN_DIR}/etc/config" ]; then
sdkman_config_tmp="$(mktemp)"
awk -v api="${SDKMAN_SERVICE_MIRROR}" '
BEGIN { updated=0 }
/^sdkman_api=/ { print "sdkman_api=" api; updated=1; next }
{ print }
END { if (updated == 0) print "sdkman_api=" api }
' "${SDKMAN_DIR}/etc/config" > "${sdkman_config_tmp}"
cat "${sdkman_config_tmp}" > "${SDKMAN_DIR}/etc/config"
rm -f "${sdkman_config_tmp}"
fi
# For RHEL 8 systems, also disable native CLI in config file and remove native binaries
if [ "${ADJUSTED_ID}" = "rhel" ] && [ "${MAJOR_VERSION_ID}" = "8" ]; then
# Disable native CLI in config to prevent future usage
Expand Down
Loading