Skip to content

deploy local: Docker check should abort when Docker is unavailableΒ #69

@ewega

Description

@ewega

Problem

gh devlake deploy local checks Docker availability and prints a warning when Docker Desktop isn't running, but then proceeds to call docker compose up anyway. This produces a confusing low-level pipe error:

🐳 Checking Docker...
   ⚠️  Docker not found or not running
   Install Docker Desktop: https://docs.docker.com/get-docker

🐳 Building and starting containers in C:\Users\eldrickt\devlake-local...
   (Building from source β€” this may take a few minutes on first run)

Error: docker compose up failed: exit status 1
...
open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specified.

The Docker check at cmd/deploy_local.go:173-179 is a non-blocking warning β€” it never gates the startLocalContainers() call that follows.

Additionally, internal/docker/build.go defines a CheckAvailable() helper that is never called anywhere.

Proposed Solution

  1. Abort early when Docker is not available β€” return a clear error instead of continuing to docker compose up.
  2. Use docker.CheckAvailable() from internal/docker/build.go instead of the inline check β€” DRY up the duplicate logic.
  3. Improve the error message β€” tell the user exactly what to do (start Docker Desktop, then re-run) rather than dumping raw docker compose output.

Expected behavior after fix:

🐳 Checking Docker...
   ❌ Docker not found or not running
   Install Docker Desktop: https://docs.docker.com/get-docker
   Start Docker Desktop, then re-run: gh devlake deploy local

(command exits with non-zero status, no docker compose up attempt)

Scope of Changes

  • cmd/deploy_local.go β€” replace inline Docker check with docker.CheckAvailable() call; return error on failure instead of printing ⚠️ and continuing.
  • internal/docker/build.go β€” no changes needed (helper already exists).

Acceptance Criteria

  • When Docker is not running, deploy local aborts immediately after the check with a clear error message
  • No docker compose up attempt is made when Docker is unavailable
  • docker.CheckAvailable() is used instead of inline exec.Command check
  • go build ./..., go test ./..., go vet ./... all pass

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions