Public Access
DEVX-21: fix: always start dockerd in CI runner for molecule tests
Post-merge / detect-type (push) Successful in 6s
Post-merge / validate-commit-msg (push) Successful in 14s
Post-merge / configure-repo (push) Successful in 14s
Post-merge / release (push) Successful in 40s
Post-merge / vikunja (push) Successful in 15s
Post-merge / sync-wiki (push) Successful in 51s
Post-merge / badges (push) Successful in 59s
Post-merge / detect-type (push) Successful in 6s
Post-merge / validate-commit-msg (push) Successful in 14s
Post-merge / configure-repo (push) Successful in 14s
Post-merge / release (push) Successful in 40s
Post-merge / vikunja (push) Successful in 15s
Post-merge / sync-wiki (push) Successful in 51s
Post-merge / badges (push) Successful in 59s
This commit was merged in pull request #35.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Start a Docker daemon inside a CI runner container (Docker-in-Docker).
|
||||
|
||||
CI runners (e.g. ``gitea/runner-images:ubuntu-latest``) may not have a
|
||||
Docker daemon running. This module starts ``dockerd`` in the background
|
||||
and waits for it to become ready, or exits immediately if Docker is
|
||||
already available.
|
||||
CI runners (e.g. ``gitea/runner-images:ubuntu-latest``) may have the host's
|
||||
Docker socket mounted, but molecule needs a local Docker daemon to create
|
||||
nested containers. This module always starts ``dockerd`` in the background
|
||||
and waits for it to become ready.
|
||||
|
||||
Usage::
|
||||
|
||||
@@ -38,14 +38,13 @@ def is_docker_ready() -> bool:
|
||||
def start_docker_daemon(timeout: int = DEFAULT_TIMEOUT) -> bool:
|
||||
"""Start dockerd in the background and wait for it to be ready.
|
||||
|
||||
Returns ``True`` if Docker is ready (either already running or
|
||||
successfully started), ``False`` if it failed to start within
|
||||
the timeout.
|
||||
"""
|
||||
if is_docker_ready():
|
||||
click.echo(_("Docker daemon already running"))
|
||||
return True
|
||||
Always starts a local dockerd even if ``docker info`` succeeds,
|
||||
because the host socket may be mounted but not suitable for
|
||||
molecule's nested container creation.
|
||||
|
||||
Returns ``True`` if Docker is ready, ``False`` if it failed to
|
||||
start within the timeout.
|
||||
"""
|
||||
click.echo(_("Starting Docker daemon..."))
|
||||
log_file = open(DOCKERD_LOG, "w") # noqa: SIM115
|
||||
subprocess.Popen( # nosec B603 B607
|
||||
|
||||
@@ -419,13 +419,6 @@
|
||||
"ru": "Created release commit.",
|
||||
"zh": "Created release commit."
|
||||
},
|
||||
"Docker daemon already running": {
|
||||
"bg": "Docker daemon already running",
|
||||
"de": "Docker-Daemon läuft bereits",
|
||||
"en": "Docker daemon already running",
|
||||
"ru": "Docker-демон уже запущен",
|
||||
"zh": "Docker 守护进程已在运行"
|
||||
},
|
||||
"Docker daemon failed to start": {
|
||||
"bg": "Docker daemon failed to start",
|
||||
"de": "Docker-Daemon konnte nicht gestartet werden",
|
||||
|
||||
Reference in New Issue
Block a user