Use disk-backed containerd snapshotter in dind
This commit is contained in:
1 parent
4b55d6e402
commit
6f19f86522
5 files changed
+39
-123
No files matched your search
@@ -16,11 +16,22 @@
|
||||
|
||||
set -xe -o pipefail
|
||||
|
||||
USE_OVERLAY_DRIVER=true
|
||||
USE_TMPFS=true
|
||||
DISABLE_CONTAINERD_SNAPSHOTTER=false
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--no-overlay)
|
||||
USE_OVERLAY_DRIVER=false
|
||||
# Legacy gVisor behavior: skip tmpfs and disable the containerd
|
||||
# snapshotter. This can fail on images with security.capability xattrs.
|
||||
USE_TMPFS=false
|
||||
DISABLE_CONTAINERD_SNAPSHOTTER=true
|
||||
shift
|
||||
;;
|
||||
--disk-store)
|
||||
# Use the disk-backed /var/lib/docker volume but keep Docker 29's
|
||||
# containerd snapshotter. This supports file-capability xattrs.
|
||||
USE_TMPFS=false
|
||||
DISABLE_CONTAINERD_SNAPSHOTTER=false
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
@@ -32,7 +43,7 @@ done
|
||||
# When dockerd uses the overlay storage driver, it will try to mount an overlay
|
||||
# filesystem under /var/lib/docker. gVisor only supports tmpfs as an upper
|
||||
# layer, so we mount a tmpfs if it isn't already present.
|
||||
if [[ "${USE_OVERLAY_DRIVER}" == "true" ]]; then
|
||||
if [[ "${USE_TMPFS}" == "true" ]]; then
|
||||
current_fs=$(stat -f -c %T /var/lib/docker 2>/dev/null || echo "none")
|
||||
if [[ "${current_fs}" != "tmpfs" ]]; then
|
||||
mkdir -p /var/lib/docker
|
||||
@@ -47,7 +58,7 @@ docker_version=$(dockerd --version)
|
||||
# Docker 29+ does not automatically fall back to the vfs driver when it cannot
|
||||
# mount an overlayfs, so we explicitly disable it when --no-overlay is passed.
|
||||
if [[ ${docker_version} =~ version\ ([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 29 ]]; then
|
||||
if [[ "${USE_OVERLAY_DRIVER}" != "true" ]]; then
|
||||
if [[ "${DISABLE_CONTAINERD_SNAPSHOTTER}" == "true" ]]; then
|
||||
EXTRA_DOCKERD_FLAGS+=(--feature containerd-snapshotter=false)
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user