r"""Check if the Docker daemon is running. Returns: bool: True if the Docker daemon is running, False otherwise.
()
| 519 | |
| 520 | |
| 521 | def is_docker_running() -> bool: |
| 522 | r"""Check if the Docker daemon is running. |
| 523 | |
| 524 | Returns: |
| 525 | bool: True if the Docker daemon is running, False otherwise. |
| 526 | """ |
| 527 | try: |
| 528 | result = subprocess.run( |
| 529 | ["docker", "info"], |
| 530 | check=True, |
| 531 | stdout=subprocess.PIPE, |
| 532 | stderr=subprocess.PIPE, |
| 533 | ) |
| 534 | return result.returncode == 0 |
| 535 | except (subprocess.CalledProcessError, FileNotFoundError): |
| 536 | return False |
| 537 | |
| 538 | |
| 539 | try: |
no test coverage detected