Skip to content

Commit da45251

Browse files
[docker] Add Debian Trixie to the docker-in-docker and docker-outside-of-docker distro lists (#1442)
* Add Debian Trixie to the docker-* distro list * Grammar * Fix Microsoft signing keys for Debian Trixie in docker-* * Test docker installation on debian trixie * Handle possibly missing moby package in docker-outside-of-docker installation * Remove trixie test with `moby: true` --------- Co-authored-by: Álvaro Rausell Guiard <[email protected]>
1 parent 849a5e2 commit da45251

File tree

10 files changed

+64
-15
lines changed

10 files changed

+64
-15
lines changed

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.12.2",
3+
"version": "2.12.3",
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: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
1818
INSTALL_DOCKER_BUILDX="${INSTALLDOCKERBUILDX:-"true"}"
1919
INSTALL_DOCKER_COMPOSE_SWITCH="${INSTALLDOCKERCOMPOSESWITCH:-"true"}"
2020
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
21-
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal jammy noble"
22-
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal hirsute impish jammy noble"
21+
MICROSOFT_GPG_KEYS_ROLLING_URI="https://packages.microsoft.com/keys/microsoft-rolling.asc"
22+
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal jammy noble"
23+
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal hirsute impish jammy noble"
2324
DISABLE_IP6_TABLES="${DISABLEIP6TABLES:-false}"
2425

2526
# Default: Exit on any failure.
@@ -198,14 +199,14 @@ architecture="$(dpkg --print-architecture)"
198199
if [ "${USE_MOBY}" = "true" ]; then
199200
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
200201
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution"
201-
err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
202+
err "Supported distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
202203
exit 1
203204
fi
204205
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'"
205206
else
206207
if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
207208
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution"
208-
err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
209+
err "Supported distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
209210
exit 1
210211
fi
211212
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'"
@@ -233,7 +234,10 @@ if [ "${USE_MOBY}" = "true" ]; then
233234
cli_package_name="moby-cli"
234235

235236
# Import key safely and import Microsoft apt repo
236-
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
237+
{
238+
curl -sSL ${MICROSOFT_GPG_KEYS_URI}
239+
curl -sSL ${MICROSOFT_GPG_KEYS_ROLLING_URI}
240+
} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
237241
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
238242
else
239243
# Name of licensed engine/cli
@@ -305,7 +309,7 @@ else
305309
set -e
306310

307311
if [ ${exit_code} -ne 0 ]; then
308-
err "Packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-20.04')."
312+
err "Packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-24.04')."
309313
exit 1
310314
fi
311315

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.6.3",
3+
"version": "1.6.4",
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: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ TARGET_SOCKET="${TARGET_SOCKET:-"/var/run/docker.sock"}"
1818
USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
1919
INSTALL_DOCKER_BUILDX="${INSTALLDOCKERBUILDX:-"true"}"
2020
INSTALL_DOCKER_COMPOSE_SWITCH="${INSTALLDOCKERCOMPOSESWITCH:-"true"}"
21-
2221
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
23-
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal jammy noble plucky"
24-
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="bookworm buster bullseye bionic focal hirsute impish jammy noble plucky"
22+
MICROSOFT_GPG_KEYS_ROLLING_URI="https://packages.microsoft.com/keys/microsoft-rolling.asc"
23+
DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal jammy noble plucky"
24+
DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES="trixie bookworm buster bullseye bionic focal hirsute impish jammy noble plucky"
2525

2626
set -e
2727

@@ -205,14 +205,14 @@ architecture="$(dpkg --print-architecture)"
205205
if [ "${USE_MOBY}" = "true" ]; then
206206
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
207207
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS distribution"
208-
err "Support distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
208+
err "Supported distributions include: ${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}"
209209
exit 1
210210
fi
211211
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}'"
212212
else
213213
if [[ "${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then
214214
err "Unsupported distribution version '${VERSION_CODENAME}'. To resolve, please choose a compatible OS distribution"
215-
err "Support distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
215+
err "Supported distributions include: ${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}"
216216
exit 1
217217
fi
218218
echo "Distro codename '${VERSION_CODENAME}' matched filter '${DOCKER_LICENSED_ARCHIVE_VERSION_CODENAMES}'"
@@ -224,7 +224,10 @@ if [ "${USE_MOBY}" = "true" ]; then
224224
cli_package_name="moby-cli"
225225

226226
# Import key safely and import Microsoft apt repo
227-
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
227+
{
228+
curl -sSL ${MICROSOFT_GPG_KEYS_URI}
229+
curl -sSL ${MICROSOFT_GPG_KEYS_ROLLING_URI}
230+
} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
228231
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
229232
else
230233
# Name of proprietary engine package
@@ -302,7 +305,7 @@ else
302305
if [ "${INSTALL_DOCKER_BUILDX}" = "true" ]; then
303306
buildx=(moby-buildx${buildx_version_suffix})
304307
fi
305-
apt-get -y install --no-install-recommends ${cli_package_name}${cli_version_suffix} "${buildx[@]}"
308+
apt-get -y install --no-install-recommends ${cli_package_name}${cli_version_suffix} "${buildx[@]}" || { err "It seems packages for moby not available in OS ${ID} ${VERSION_CODENAME} (${architecture}). To resolve, either: (1) set feature option '\"moby\": false' , or (2) choose a compatible OS version (eg: 'ubuntu-24.04')." ; exit 1 ; }
306309
apt-get -y install --no-install-recommends moby-compose || echo "(*) Package moby-compose (Docker Compose v2) not available for OS ${ID} ${VERSION_CODENAME} (${architecture}). Skipping."
307310
else
308311
buildx=()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_on_debian_trixie.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "docker installed" bash -c "type docker"
10+
11+
# Report results
12+
reportResults

test/docker-in-docker/scenarios.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,14 @@
134134
}
135135
}
136136
},
137+
"install_on_debian_trixie": {
138+
"image": "debian:trixie",
139+
"features": {
140+
"docker-in-docker": {
141+
"moby": false
142+
}
143+
}
144+
},
137145
"docker_specific_moby_buildx": {
138146
"image": "ubuntu:noble",
139147
"features": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install_on_debian_trixie.sh
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Import test library
6+
source dev-container-features-test-lib
7+
8+
# Definition specific tests
9+
check "docker installed" bash -c "type docker"
10+
11+
# Report results
12+
reportResults

test/docker-outside-of-docker/scenarios.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,13 @@
172172
}
173173
},
174174
"containerUser": "vscode"
175+
},
176+
"install_on_debian_trixie": {
177+
"image": "debian:trixie",
178+
"features": {
179+
"docker-outside-of-docker": {
180+
"moby": false
181+
}
182+
}
175183
}
176184
}

0 commit comments

Comments
 (0)