fix(docker-in-docker): disable containerd erofs snapshotter to fix dockerd startup#1645
Open
Kaniska244 wants to merge 12 commits into
Open
fix(docker-in-docker): disable containerd erofs snapshotter to fix dockerd startup#1645Kaniska244 wants to merge 12 commits into
Kaniska244 wants to merge 12 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1642 and #1639.
This PR fixes
docker-in-dockerstartup failures caused bycontainerd >= 2.3probing theerofssnapshotter on hosts where the kernel exposes theerofsfilesystem.The main fix is to disable the
io.containerd.snapshotter.v1.erofsplugin incontainerdconfig and ensuredockerdactually uses that config by startingcontainerdexplicitly and passing its socket todockerd.In addition, this PR includes a few related improvements and test updates in the
docker-in-dockerfeature.Problem
On some hosts,
dockerdfails to start because bundledcontainerdprobes theerofssnapshotter plugin during startup.That plugin requires
mkfs.erofssupport that is not available in older distro versions oferofs-utils, especially on:bookworm)jammy)When the host kernel exposes
erofs, plugin initialization fails,containerdnever becomes ready, anddockerdtimes out.This is especially visible on newer environments such as:
erofshas been loaded explicitlySince the feature uses
overlayfsanyway, the safest fix is to disable theerofssnapshotter entirely.Why the previous config-only approach was insufficient
A config-only change under
/etc/containerd/config.tomlwas not enough becausedockerd, when started normally, launches its own childcontainerdinstance using an auto-generated config under/var/run/docker/containerd/.That means
/etc/containerd/config.tomlis ignored unless we explicitly startcontainerdourselves and pointdockerdto it.This PR therefore applies a two-part fix:
disabled_pluginsentry into/etc/containerd/config.tomlcontainerdexplicitly and rundockerdwith--containerd /run/containerd/containerd.sockMain changes
1. Disable the
erofssnapshotter incontainerdIn
src/docker-in-docker/install.sh:/etc/containerd/config.tomlexistscontainerd config defaultio.containerd.snapshotter.v1.erofsto top-leveldisabled_pluginsdisabled_pluginskey yetThis makes the configuration safe for re-runs and image-layer reuse.
2. Start
containerdexplicitly beforedockerdAlso in
src/docker-in-docker/install.sh, the generated init flow now:containerdbinarycontainerd --config /etc/containerd/config.toml/run/containerd/containerd.sock--containerd /run/containerd/containerd.socktodockerddockerdspawns its owncontainerdThis keeps the fix additive and avoids breaking hosts where explicit
containerdstartup is not available.The retry/cleanup flow also continues to clean up
containerdalongsidedockerd.3. Add
erofs-utilson Debian installsIn the Debian package path of
src/docker-in-docker/install.sh, this PR adds:erofs-utilsThis ensures
mkfs.erofsis available where relevant and documents the dependency clearly, even though the primary fix is still disabling the snapshotter.4. Fix Docker CE package download architecture handling for RHEL/tdnf path
In
src/docker-in-docker/install.sh, the Docker CE RPM download logic now derives the correct repository architecture dynamically instead of hardcodingx86_64.This adds support for architectures such as:
x86_64aarch64and updates the RPM lookup/download patterns accordingly.
This improves portability for non-x86 environments.
5. Install Docker Compose v1 in an isolated virtual environment
In
src/docker-in-docker/install.sh, the Compose v1 installation path now:pip,setuptools, andwheelinto that venvdocker-composeand dependencies theredocker-composebinary into the expected pathThis avoids PEP 668 / externally-managed-environment issues on newer distros such as:
and avoids modifying distro-managed Python site-packages.
Test updates
Workflow update
In
.github/workflows/test-pr-arm64.yaml:src/docker-in-docker/**andtest/docker-in-docker/**in workflow path triggersdocker-in-dockerfilter in changed-path detectionerofskernel module:sudo modprobe erofs && grep erofs /proc/filesystemsThis makes the failure scenario reproducible in CI.
There is also a matrix exclusion added for:
docker-in-docker+mcr.microsoft.com/devcontainers/base:debianTest script updates
The following test scripts now explicitly verify that Docker is actually usable by adding
docker pschecks:test/docker-in-docker/dockerIp6tablesDisabledTest.shtest/docker-in-docker/docker_build_older.shtest/docker-in-docker/pin_docker-ce_version_moby_false.shThis strengthens validation by confirming that
dockerdnot only starts, but is usable.Docs / metadata updates
This PR also updates
docker-in-dockerfeature metadata and documentation:src/docker-in-docker/devcontainer-feature.json2.17.0to3.0.0src/docker-in-docker/README.mdghcr.io/devcontainers/features/docker-in-docker:2ghcr.io/devcontainers/features/docker-in-docker:3src/docker-in-docker/NOTES.mdmcr.microsoft.com/devcontainers/typescript-node:16mcr.microsoft.com/devcontainers/typescript-node:24Files changed
.github/workflows/test-pr-arm64.yamlsrc/docker-in-docker/NOTES.mdsrc/docker-in-docker/README.mdsrc/docker-in-docker/devcontainer-feature.jsonsrc/docker-in-docker/install.shtest/docker-in-docker/dockerIp6tablesDisabledTest.shtest/docker-in-docker/docker_build_older.shtest/docker-in-docker/pin_docker-ce_version_moby_false.shCompatibility / risk
erofssnapshotter is not relevantcontainerdstartup is unavailableoverlayfspathResult
This PR makes
docker-in-dockerstartup more reliable across affected Debian/Ubuntu environments, especially on arm64 and newer hosts whereerofsis exposed, while also improving test coverage, compose installation robustness, and architecture handling.Related