Skip to content

Commit 4b252c9

Browse files
authored
update MICROSOFT_GPG_KEYS_URI (#21)
* update MICROSOFT_GPG_KEYS_URI * bump versions * remove get_common_setting (always points to old key)
1 parent 5c590c3 commit 4b252c9

5 files changed

Lines changed: 43 additions & 13 deletions

File tree

‎.github/workflows/test.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ jobs:
1616
- azure-functions-core-tools
1717
- mssql-odbc-driver
1818
baseImage:
19-
- debian:11
19+
- debian:12
2020
- debian:latest
2121
- ubuntu:22.04
22+
- ubuntu:24.04
2223
- ubuntu:latest
2324
- mcr.microsoft.com/devcontainers/base:ubuntu
2425
steps:

‎src/azure-functions-core-tools/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-functions-core-tools",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"name": "Azure Functions Core Tools",
55
"documentationURL": "https://github.com/jlaundry/devcontainer-features/tree/main/src/azure-functions-core-tools",
66
"description": "Installs the Azure Functions Core Tools along with needed dependencies. Useful for developing Azure Function apps inside codespaces.",

‎src/azure-functions-core-tools/install.sh‎

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ rm -rf /var/lib/apt/lists/*
1414

1515
AZ_VERSION=${VERSION:-"latest"}
1616

17-
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
17+
OS_VERSION_ID="$(source /etc/os-release; echo "${ID}:${VERSION_ID}")"
18+
case $OS_VERSION_ID in
19+
debian:10) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
20+
debian:11) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
21+
debian:12) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
22+
debian:13) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
23+
ubuntu:20.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
24+
ubuntu:22.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
25+
ubuntu:24.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
26+
ubuntu:26.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
27+
*) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
28+
esac
29+
30+
echo "using Microsoft GPG key ${MICROSOFT_GPG_KEYS_URI} for ${OS_VERSION_ID}"
1831

1932
if [ "$(id -u)" -ne 0 ]; then
2033
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -98,12 +111,14 @@ apt_cache_version_soft_match() {
98111
}
99112

100113
install_using_apt() {
114+
echo "installing azure-functions-core-tools with AZ_VERSION=${AZ_VERSION} using MICROSOFT_GPG_KEYS_URI=${MICROSOFT_GPG_KEYS_URI} on ${architecture}"
115+
101116
# Install dependencies
102117
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
118+
103119
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
104-
get_common_setting MICROSOFT_GPG_KEYS_URI
105-
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
106-
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-functions-core-tools.list
120+
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-prod.gpg
121+
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-functions-core-tools.list
107122
apt-get update
108123

109124
if [ "${AZ_VERSION}" = "latest" ] || [ "${AZ_VERSION}" = "lts" ] || [ "${AZ_VERSION}" = "stable" ]; then

‎src/mssql-odbc-driver/devcontainer-feature.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "mssql-odbc-driver",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"name": "SQL Server ODBC Driver",
55
"documentationURL": "https://github.com/jlaundry/devcontainer-features/tree/main/src/mssql-odbc-driver",
66
"description": "Installs the Microsoft SQL Server ODBC Driver.",

‎src/mssql-odbc-driver/install.sh‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,22 @@ set -e
1212
# Clean up
1313
rm -rf /var/lib/apt/lists/*
1414

15-
ODBC_VERSION=${VERSION:-"latest"}
16-
17-
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
ODBC_VERSION=${VERSION:-"18"}
16+
17+
OS_VERSION_ID="$(source /etc/os-release; echo "${ID}:${VERSION_ID}")"
18+
case $OS_VERSION_ID in
19+
debian:10) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
20+
debian:11) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
21+
debian:12) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
22+
debian:13) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
23+
ubuntu:20.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
24+
ubuntu:22.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
25+
ubuntu:24.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" ;;
26+
ubuntu:26.04) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
27+
*) MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft-2025.asc" ;;
28+
esac
29+
30+
echo "using Microsoft GPG key ${MICROSOFT_GPG_KEYS_URI} for ${OS_VERSION_ID}"
1831

1932
if [ "$(id -u)" -ne 0 ]; then
2033
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -51,13 +64,14 @@ export DEBIAN_FRONTEND=noninteractive
5164

5265

5366
install_using_apt() {
67+
echo "installing msodbcsql withODBC_VERSION=${ODBC_VERSION} using MICROSOFT_GPG_KEYS_URI=${MICROSOFT_GPG_KEYS_URI} on ${architecture}"
5468
# Install dependencies
5569
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
70+
5671
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
57-
get_common_setting MICROSOFT_GPG_KEYS_URI
58-
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
72+
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-prod.gpg
5973

60-
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/mssql-release.list
74+
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-prod.gpg] https://packages.microsoft.com/$ID/$VERSION_ID/prod ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/mssql-release.list
6175
apt-get update
6276

6377
if [ $ODBC_VERSION -eq "18" ]; then

0 commit comments

Comments
 (0)