Skip to content

feat(cli): add docker runtime check to doctor command#149

Open
iamraydoan wants to merge 1 commit into
oblien:mainfrom
iamraydoan:feat/cli-doctor-docker-check
Open

feat(cli): add docker runtime check to doctor command#149
iamraydoan wants to merge 1 commit into
oblien:mainfrom
iamraydoan:feat/cli-doctor-docker-check

Conversation

@iamraydoan

Copy link
Copy Markdown

Summary

This PR adds a Docker runtime check to the openship doctor CLI command. Since Openship relies heavily on Docker containers for deployment and service management, validating Docker availability during preflight checks helps developers diagnose local environment issues early before attempting builds or deployments.

Changes

  • Added dockerCheck() in apps/cli/src/commands/doctor.ts:
    • Executes docker --version to extract the installed Docker Engine version.
    • Executes docker info to verify whether the Docker daemon is currently running.
  • Status handling:
    • pass: Docker Engine installed AND daemon is running (27.1.2 (running)).
    • warn: Docker installed BUT daemon is stopped (27.1.2 (installed, but daemon is not running)).
    • warn: Docker is not installed (not installed (optional for CLI, required for container builds)).
  • Integrated into both standard human-readable text output and --json machine-readable output.

Why

Currently, openship doctor validates Node.js, Bun, Config file, and API health, but completely omits Docker. If a user runs openship deploy without Docker running, the deploy pipeline fails downstream. Adding this check directly in doctor provides immediate visibility.

Verification & Testing

Tested locally with bun run --cwd apps/cli build and executed via node apps/cli/dist/index.js doctor.

Human-readable Output:

  Openship doctor

  ! config   not found (/home/ubuntu/.openship/config.json); run `openship login`
  ! context  default has no token; run `openship login`
  ✗ api      unreachable: The operation was aborted due to timeout
  ✓ node     22.22.2
  ✓ bun      1.2.14
  ✓ docker   27.1.2 (running)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant