Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Datahub project Datahub Docker CLI Check

From Leeroopedia


Field Value
Page Type Implementation (External Tool Doc)
Workflow Docker_Quickstart_Deployment
Implementation Name Docker_CLI_Check
Repository Datahub_project_Datahub
Implements Principle:Datahub_project_Datahub_Docker_Prerequisites
Last Updated 2026-02-09 17:00 GMT

Overview

Description

Docker_CLI_Check is a Click-based CLI command exposed via the datahub docker check subcommand. It validates that the host environment satisfies all prerequisites required for a successful DataHub quickstart deployment. The command inspects the Docker runtime, verifies Docker Compose availability, checks allocated memory, and confirms that required network ports are free.

Usage

Run the check command before attempting a quickstart deployment:

# Verify all Docker prerequisites
datahub docker check

The command exits with code 0 if all checks pass, or a non-zero exit code with diagnostic messages if any check fails.

Code Reference

Source Location

File Lines Description
metadata-ingestion/src/datahub/cli/docker_cli.py L151 Entry point for the check subcommand
metadata-ingestion/src/datahub/cli/docker_check.py L1-50 Core check logic (memory, ports, Docker version)

Signature

@docker.command()
def check() -> None:
    """Check that the Docker prerequisites are met."""
    ...

The underlying docker_cli.check() Click command delegates to helper functions that inspect the Docker environment.

Import

from datahub.cli.docker_cli import docker

I/O Contract

Direction Name Type Description
Input (none) -- The command takes no arguments; it inspects the host environment directly.
Output stdout str Human-readable status messages for each check (Docker Engine, Compose, memory, ports).
Output exit code int 0 on success; non-zero on failure.

Requirements

Requirement Minimum Version / Value
Docker Engine >= 20.10
Docker Compose v2 (standalone or CLI plugin)
Docker Memory >= 8 GB allocated
Port 8080 Must be free (GMS service)
Port 9002 Must be free (Frontend service)

Usage Examples

Basic Prerequisite Check

# Run the prerequisite check
datahub docker check

# Expected output (all passing):
# Docker Engine: OK (version 24.0.7)
# Docker Compose: OK (v2.23.0)
# Memory: OK (12 GB allocated)
# Port 8080: OK (free)
# Port 9002: OK (free)

Handling a Failed Check

# If Docker memory is insufficient:
datahub docker check
# Docker Engine: OK (version 24.0.7)
# Docker Compose: OK (v2.23.0)
# Memory: FAIL (4 GB allocated, 8 GB required)
# ...
# Exit code: 1

To resolve, increase Docker Desktop memory allocation to at least 8 GB in Settings > Resources > Advanced.

Programmatic Usage

from datahub.cli.docker_cli import docker
from click.testing import CliRunner

runner = CliRunner()
result = runner.invoke(docker, ["check"])
if result.exit_code != 0:
    print(f"Prerequisites not met: {result.output}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment