Skip to content
Draft

test PR #1652

Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 42 additions & 0 deletions test/docker-in-docker/overlayfs_containerd_root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
#
# Regression test for devcontainers/features#1639 / PR #1645 follow-up:
# verifies that when the dev container's root filesystem is overlayfs
# (the default under Docker / containerd-backed hosts), the standalone
# containerd started by the docker-in-docker Feature does NOT place its
# overlayfs snapshotter data on an overlay rootfs (which would fail with
# `invalid argument` when pulling images).
#
set -e

source dev-container-features-test-lib

# 1. Confirm we're really reproducing the affected condition:
# the dev container's / must be overlay.
check "rootfs is overlay (precondition)" \
bash -c '[ "$(findmnt -no FSTYPE /)" = "overlay" ]'

# 2. The Feature's volume mount must shadow /var/lib/containerd with a
# non-overlay filesystem. Without the mount, containerd's overlayfs
# snapshotter would be writing onto the overlay rootfs and fail at
# pull time.
check "/var/lib/containerd is not overlay" \
bash -c '[ "$(findmnt -no FSTYPE /var/lib/containerd)" != "overlay" ]'

check "/var/lib/docker is not overlay" \
bash -c '[ "$(findmnt -no FSTYPE /var/lib/docker)" != "overlay" ]'

# 3. The actual symptom: pulling and running an image must succeed.
# Pre-PR-#1645 this fails with:
# failed to mount /tmp/containerd-mountXXXXX ... err: invalid argument
check "docker run hello-world" \
docker run --rm hello-world

# 4. Belt-and-braces: confirm dockerd is actually using the
# containerd-snapshotter path so we know this test exercises the
# affected code path, not the legacy overlay2 driver.
check "containerd-snapshotter active" \
bash -c "docker info 2>/dev/null | grep -qiE 'driver-type: io.containerd.snapshotter.v1|Storage Driver: overlayfs'"

reportResults

9 changes: 9 additions & 0 deletions test/docker-in-docker/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
{
"overlayfs_containerd_root": {
"image": "mcr.microsoft.com/devcontainers/base:noble",
"features": {
"docker-in-docker": {
"version": "latest",
"moby": true
}
}
},
"docker_build_fallback_compose": {
"image": "ubuntu:noble",
"features": {
Expand Down
Loading