DEVX-23: fix: use tempfile for dockerd log to fix CI permission error

This commit is contained in:
emil
2026-06-24 00:45:28 +00:00
parent 011cf3e093
commit 16fba17b03
3 changed files with 18 additions and 12 deletions
+4 -2
View File
@@ -15,6 +15,7 @@ from __future__ import annotations
import subprocess # nosec B404
import sys
import tempfile
import time
import click
@@ -22,7 +23,6 @@ import click
from devx.i18n import _
DEFAULT_TIMEOUT = 30
DOCKERD_LOG = "/var/log/dockerd.log"
def is_docker_ready() -> bool:
@@ -46,7 +46,9 @@ def start_docker_daemon(timeout: int = DEFAULT_TIMEOUT) -> bool:
start within the timeout.
"""
click.echo(_("Starting Docker daemon..."))
log_file = open(DOCKERD_LOG, "w") # noqa: SIM115
log_file = tempfile.NamedTemporaryFile( # noqa: SIM115
mode="w", suffix="dockerd.log", delete=False
)
subprocess.Popen( # nosec B603 B607
["dockerd", "--storage-driver", "vfs"],
stdout=log_file,