DEVX-155: fix: check /run/host-docker.sock for host Docker daemon
Post-merge / detect-and-configure (push) Canceled after 0s
Post-merge / release-and-maintain (push) Canceled after 0s

The gitea_runner config now mounts the rootless Docker socket at
/run/host-docker.sock. start_docker.py checks this path first,
giving CI containers access to the host's full filesystem (455 GB)
instead of the container's limited overlay (38 GB).

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-14 18:03:32 +02:00
co-authored by Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
parent 23bd480e80
commit 0c2388f063
+11
View File
@@ -39,6 +39,12 @@ DEFAULT_TIMEOUT = 30
DOCKER_SOCK = "/var/run/docker.sock"
# Rootless socket fallback (e.g. /run/user/994/docker.sock)
ROOTLESS_SOCK = f"/run/user/{os.getuid()}/docker.sock"
# Host Docker socket mounted by gitea_runner config (see runner config
# ``options: "-v /run/user/<uid>/docker.sock:/run/host-docker.sock"``).
# This gives CI containers access to the host's rootless Docker daemon,
# which has the full host filesystem (e.g. 455 GB) instead of the
# container's limited overlay (e.g. 38 GB).
HOST_DOCKER_SOCK = "/run/host-docker.sock"
# Minimum free bytes for a Docker daemon to be considered usable.
# Below this, image pulls and container creation will fail with ENOSPC.
# 20 GB leaves room for molecule-test-base (~500 MB) + a few containers.
@@ -184,6 +190,11 @@ def start_docker_daemon(timeout: int = DEFAULT_TIMEOUT) -> bool:
# Collect candidate rootless sockets
candidates: list[str] = []
# The host Docker socket is mounted by the gitea_runner config.
# This is the preferred candidate — it has access to the host's
# full filesystem instead of the container's limited overlay.
if os.path.exists(HOST_DOCKER_SOCK):
candidates.append(HOST_DOCKER_SOCK)
if os.path.exists(ROOTLESS_SOCK):
candidates.append(ROOTLESS_SOCK)
for sock in sorted(glob.glob("/run/user/*/docker.sock")):