[docker-in-docker] - Fixing issue with containerd#1653
Open
Kaniska244 wants to merge 3 commits into
Open
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
This PR fixes a
docker-in-dockerissue wherecontainerdcan fail when the dev container root filesystem is itself mounted asoverlayfs.The fix adds a dedicated persisted volume for
/var/lib/containerd, ensuring that containerd snapshotter state is stored on non-overlay storage. This prevents overlay-on-overlay mount failures such asinvalid argumentduring image pull or container startup.Fixes this follow-up issue
Changes included
dind-var-lib-containerd-${devcontainerId}→/var/lib/containerddocker-in-dockerfeature version from3.0.0to3.0.1src/docker-in-docker/NOTES.mdtest/docker-in-docker/overlayfs_containerd_root.shoverlayfs_containerd_rootmcr.microsoft.com/devcontainers/base:noblewhere neededdocker-in-dockeron Ubuntu-based imagesWhy this fix is needed
When
/var/lib/containerdlives on an overlay-backed root filesystem, the standalonecontainerdstarted by this feature may attempt to place overlayfs snapshotter data on top of another overlay mount. In affected environments, this can cause container/image operations to fail with errors like:failed to mount ... invalid argumentMounting
/var/lib/containerdon its own named volume avoids that storage layout and makes the feature work reliably in containerd-backed and overlayfs-based environments.Validation
This PR adds regression coverage to verify that:
overlay/var/lib/containerdis not mounted as overlay/var/lib/dockeris not mounted as overlaydocker run --rm hello-worldsucceedsNotes
The new persisted volumes are scoped by
${devcontainerId}, so each dev container gets isolated state while preserving images/snapshots across rebuilds. These volumes are not automatically removed when the dev container is deleted.