Skip to content

feat(docker): warn when Docker, Compose or the daemon is not available - #21

Merged
nabil1440 merged 1 commit into
blockers/4-flag-passthroughfrom
blockers/5-docker-availability
Sep 22, 2026
Merged

nabil1440 merged 1 commit into
blockers/4-flag-passthroughfrom
blockers/5-docker-availability

Conversation

@nabil1440

@nabil1440 nabil1440 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Change

  • docker.Check examines three parts, each with a 5 s timeout:
    • the Docker CLI (PATH)
    • the Compose plugin (docker compose version --short)
    • the daemon (docker version --format {{.Server.Version}})
  • Commands that need Docker declare it with requireDocker. The root command runs the check before these commands.
  • If a part is not available, fly shows one warning line and exits with status 69 (EX_UNAVAILABLE). No command panics, and no raw exec: error shows.
  • fly status shows the three parts on separate lines and exits with status 0.

Why this design

  • requireDocker marks the commands that need Docker. The capability work can use the same mark to set the Docker capability online or offline.
  • When Docker is healthy, the check adds approximately 30 ms.

Tests

  • Unit tests for Check: available, no CLI, no Compose plugin, daemon down and daemon timeout. Unit tests for Status.
  • End-to-end tests: 5 commands in 3 failure conditions give exit status 69, one warning line and no Compose call. fly status gives exit status 0 and three lines.
  • Real Docker:
    • When Docker is healthy, fly status shows the three parts.
    • With DOCKER_HOST set to a socket that does not exist, fly start shows the daemon warning and exits with status 69.
    • With no docker in PATH, fly wp shows the CLI warning and exits with status 69.

Closes #5

@nabil1440
nabil1440 added this pull request to stack #24 September 21, 2026 10:41
- docker.Check examines the Docker CLI (PATH), the Compose plugin
  (docker compose version) and the daemon (docker version), with a
  5 s timeout for each check.
- Commands that need Docker declare it with requireDocker. The root
  command runs the check first. If a part is not available, fly shows
  one warning line and exits with status 69 (EX_UNAVAILABLE).
- fly status shows the three parts on separate lines and exits 0.

Closes #5
@nabil1440
nabil1440 force-pushed the blockers/5-docker-availability branch from 62b5965 to b278401 Compare September 22, 2026 06:36
@nabil1440
nabil1440 merged commit 3912898 into develop Sep 22, 2026
@nabil1440
nabil1440 deleted the blockers/5-docker-availability branch September 22, 2026 06:51
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.

bug: Show a clear warning when Docker, the Compose plugin or the Docker daemon is not available

1 participant