DEVX-155: fix: trust /var/run/docker.sock with free=0 when no inner dockerd exists
Post-merge / detect-and-configure (push) Successful in 1m38s
Post-merge / release-and-maintain (push) Failing after 2m20s

The host's rootless Docker socket is mounted as /var/run/docker.sock
inside CI containers. Its data root is on the host filesystem (not
accessible from inside the container), so _get_docker_free_bytes
returns 0. Previously the code didn't trust this and started a local
dockerd on /dev/shm (too small). Now checks pgrep for dockerd processes
— if none found inside the container, the socket is the host's Docker
and should be trusted.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
emil
2026-08-15 02:29:55 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent cdbee0a317
commit 1dc27d6e4b
2 changed files with 40 additions and 1 deletions
+16
View File
@@ -210,6 +210,22 @@ def start_docker_daemon(timeout: int = DEFAULT_TIMEOUT) -> bool:
if free_bytes == 0 and sock == HOST_DOCKER_SOCK:
click.echo("Host rootless Docker root dir not accessible from container, using it")
return True
# If free_bytes is 0 and there are no dockerd processes inside the
# container, the socket is the host's Docker (mounted from outside).
# The data root is on the host filesystem and has plenty of space.
if free_bytes == 0 and sock == DOCKER_SOCK:
has_inner_dockerd = False
with contextlib.suppress(Exception):
pgrep_result = subprocess.run( # nosec B603 B607
["pgrep", "-f", "dockerd"],
capture_output=True,
text=True,
timeout=5,
)
has_inner_dockerd = pgrep_result.returncode == 0
if not has_inner_dockerd:
click.echo("No inner dockerd found, socket is host Docker (data root on host), using it")
return True
click.echo(f" Insufficient space ({free_gb:.1f} GB), trying next...")
# No socket with sufficient space found.