Skip to content

Commit 7c6ef0b

Browse files
authored
[docker-in-docker, docker-outside-of-docker] - Update documentation and putting a check to stop installation for Debian Trixie(13) (#1482)
* [docker-in-docker, docker-outside-of-docker] - Update documentation and putting a check to stop installation for Debian Trixie(13) * docker-in-docker feature test update * Test script change
1 parent 572770d commit 7c6ef0b

File tree

8 files changed

+29
-4
lines changed

8 files changed

+29
-4
lines changed

.github/workflows/test-pr.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
baseImage: ubuntu:jammy
6363
- features: oryx
6464
baseImage: mcr.microsoft.com/devcontainers/base:ubuntu
65+
- features: docker-in-docker
66+
baseImage: mcr.microsoft.com/devcontainers/base:debian
67+
- features: docker-outside-of-docker
68+
baseImage: mcr.microsoft.com/devcontainers/base:debian
6569
steps:
6670
- uses: actions/checkout@v4
6771

src/docker-in-docker/NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ This docker-in-docker Dev Container Feature is roughly based on the [official do
1313

1414
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
1515

16+
Debian Trixie (13) does not include moby-cli and related system packages, so the feature cannot install with "moby": "true". To use this feature on Trixie, please set "moby": "false" or choose a different base image (for example, Ubuntu 24.04).
17+
1618
`bash` is required to execute the `install.sh` script.

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.3",
3+
"version": "2.12.4",
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,13 @@ export DEBIAN_FRONTEND=noninteractive
195195
# Fetch host/container arch.
196196
architecture="$(dpkg --print-architecture)"
197197

198+
# Prevent attempting to install Moby on Debian trixie (packages removed)
199+
if [ "${USE_MOBY}" = "true" ] && [ "${ID}" = "debian" ] && [ "${VERSION_CODENAME}" = "trixie" ]; then
200+
err "The 'moby' option is not supported on Debian 'trixie' because 'moby-cli' and related system packages have been removed from that distribution."
201+
err "To continue, either set the feature option '\"moby\": false' or use a different base image (for example: 'debian:bookworm' or 'ubuntu-24.04')."
202+
exit 1
203+
fi
204+
198205
# Check if distro is supported
199206
if [ "${USE_MOBY}" = "true" ]; then
200207
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then

src/docker-outside-of-docker/NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,6 @@ services:
5858

5959
This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
6060

61+
Debian Trixie (13) does not include moby-cli and related system packages, so the feature cannot install with "moby": "true". To use this feature on Trixie, please set "moby": "false" or choose a different base image (for example, Ubuntu 24.04).
62+
6163
`bash` is required to execute the `install.sh` script.

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.4",
3+
"version": "1.6.5",
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ fi
201201
# Fetch host/container arch.
202202
architecture="$(dpkg --print-architecture)"
203203

204+
# Prevent attempting to install Moby on Debian trixie (packages removed)
205+
if [ "${USE_MOBY}" = "true" ] && [ "${ID}" = "debian" ] && [ "${VERSION_CODENAME}" = "trixie" ]; then
206+
err "The 'moby' option is not supported on Debian 'trixie' because 'moby-cli' and related system packages have been removed from that distribution."
207+
err "To continue, either set the feature option '\"moby\": false' or use a different base image (for example: 'debian:bookworm' or 'ubuntu-24.04')."
208+
exit 1
209+
fi
210+
204211
# Check if distro is supported
205212
if [ "${USE_MOBY}" = "true" ]; then
206213
if [[ "${DOCKER_MOBY_ARCHIVE_VERSION_CODENAMES}" != *"${VERSION_CODENAME}"* ]]; then

test/docker-in-docker/scenarios.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"image": "mcr.microsoft.com/devcontainers/base:debian",
155155
"features": {
156156
"docker-in-docker": {
157-
"version": "26.1.4",
157+
"version": "28.4.0",
158158
"moby": "false",
159159
"mobyBuildxVersion": "latest",
160160
"dockerDashComposeVersion": "none",
@@ -170,7 +170,10 @@
170170
"docker_with_on_create_command": {
171171
"image": "mcr.microsoft.com/devcontainers/base:debian",
172172
"features": {
173-
"docker-in-docker": {}
173+
"docker-in-docker": {
174+
"version": "latest",
175+
"moby": "false"
176+
}
174177
},
175178
"remoteUser": "vscode",
176179
"onCreateCommand": "docker ps && sleep 5s && docker ps"

0 commit comments

Comments
 (0)