DEVX-23: fix: use tempfile for dockerd log to fix CI permission error
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user