diff --git a/.gitignore b/.gitignore index 403a07a..fc89a21 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .env gitea/ dind-data/ +dind-overlay/ runner/.runner runner/.cache/ *.log diff --git a/README.md b/README.md index d6bd4b8..886674b 100644 --- a/README.md +++ b/README.md @@ -198,6 +198,47 @@ environment: DOCKER_TMPFS_SIZE: 5G ``` +### Image pull fails with `security.capability` / `lsetxattr` + +Example: + +```text +failed to register layer: lsetxattr /usr/bin/ping: +xattr "security.capability": operation not supported +``` + +This is not a registry or authentication problem. gVisor's host-backed +filesystem path cannot set the `security.capability` xattr on files such as +`/usr/bin/ping`, which many Ubuntu runner images contain. + +The disk-backed dind setup needs an overlay filestore to support those xattrs. +Add this to the host's `runsc-docker` runtime: + +```json +"runsc-docker": { + "path": "/usr/bin/runsc", + "runtimeArgs": [ + "--net-raw", + "--allow-packet-socket-write", + "--overlay2=all:dir=/var/lib/gvisor-overlay" + ] +} +``` + +The Compose file mounts: + +```text +./dind-overlay -> /var/lib/gvisor-overlay +``` + +With that runtime argument, Docker inside the sandbox may report the `vfs` +storage driver rather than overlay2, but image pulls with file capabilities work +and storage remains disk-backed. + +Without this host runtime change, the working alternative is the RAM-backed +tmpfs mode above. The error is a gVisor filesystem/xattr limitation, not a +runner-image label or Compose volume problem. + ## Performance (local test) Short microbenchmarks with the disk-backed dind setup (`--no-overlay`, Docker diff --git a/docker-compose.yml b/docker-compose.yml index b786940..2a808dc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,9 @@ services: - ALL volumes: - ./dind-data:/var/lib/docker + # Used by runsc --overlay2=all:dir=... to support file-capability xattrs + # on host-backed image layers. See README. + - ./dind-overlay:/var/lib/gvisor-overlay - ./dind-runsc/resolv.conf:/etc/resolv.conf:ro # Use the disk-backed dind-data volume instead of a RAM-backed tmpfs. command: --no-overlay