feat(bootstrap): add Docker preflight check before gateway startup#321
Merged
feat(bootstrap): add Docker preflight check before gateway startup#321
Conversation
Fail fast with actionable guidance when Docker is not installed, not running, or unreachable instead of starting a multi-minute deploy that times out with a cryptic error. - Add check_docker_available() preflight that pings the Docker daemon before any gateway work begins - Integrate into both gateway start and sandbox create auto-bootstrap - Probe alternative socket paths (~/.orbstack, ~/.colima) and suggest DOCKER_HOST when no default socket is found - Expand FAILURE_PATTERNS to match socket-not-found errors - Update docs to list supported Docker-compatible runtimes - Add e2e tests verifying fast failure and error message quality
…dation Adds 'openshell doctor check' that validates Docker connectivity before gateway setup. Reports pass/fail with version info and DOCKER_HOST status, giving users a quick way to verify their environment.
|
drew
added a commit
that referenced
this pull request
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Motivation
When a user runs
openshell gateway startoropenshell sandbox createwithout Docker running (or with a non-default runtime like OrbStack), the CLI would spend several minutes pulling images and waiting for k3s before timing out with a cryptic "K8s namespace not ready" error. Users had no indication that Docker was the problem or how to fix it.From user feedback: a first-time user with OrbStack installed hit "Socket not found: /var/run/docker.sock" immediately, then after setting up OrbStack hit "K8s namespace not ready" and couldn't recover without manual debugging and setting
DOCKER_HOST.Changes
Core preflight (
crates/openshell-bootstrap/src/docker.rs)check_docker_available()async function that connects, pings, and queries versiondocker_not_reachable_error()builds context-aware diagnostics:find_alternative_sockets()probes~/.colima/docker.sockand~/.orbstack/run/docker.sockIntegration (
crates/openshell-bootstrap/src/lib.rs)check_existing_deployment()anddeploy_gateway_with_logs()now call the preflight for local deploysopenshell gateway startand auto-bootstrap viasandbox createError patterns (
crates/openshell-bootstrap/src/errors.rs)Documentation
README.md: lists Docker Desktop, OrbStack, Docker Engine as supported; notes tested on Docker 28.04docs/get-started/quickstart.md: broadened prerequisite to "Docker-compatible runtime"docs/reference/support-matrix.md: added OrbStack to platform table, listed runtimes, documented DOCKER_HOSTdocs/tutorials/first-network-policy.md: updated prerequisite wordingE2E tests (
e2e/rust/tests/docker_preflight.rs)6 tests that point DOCKER_HOST at a non-existent socket and verify:
gateway startfails in <30s (not minutes)--recreateflag doesn't bypass the checksandbox createauto-bootstrap path also fails fastTesting
openshell-bootstrap(all pass)mise run pre-commitpassesmise run testpasses (all 77 bootstrap + 64 CLI tests)