Skip to content

Fix #35: use docker compose plugin (v2) with fallback to docker-compose#87

Open
ClaydeCode wants to merge 1 commit into
mainfrom
clayde/issue-35
Open

Fix #35: use docker compose plugin (v2) with fallback to docker-compose#87
ClaydeCode wants to merge 1 commit into
mainfrom
clayde/issue-35

Conversation

@ClaydeCode
Copy link
Copy Markdown
Contributor

Summary

  • Add compose_command() helper in shard_core/util/subprocess.py that detects once (via lru_cache) whether the Docker Compose v2 plugin is available (docker compose version), preferring ("docker", "compose") and falling back to ("docker-compose",).
  • Replace all hard-coded "docker-compose" invocations in shard_core/service/app_tools.py with *compose_command().
  • Update Dockerfile to drop the standalone docker-compose APT package; the get.docker.com install script already ships the compose plugin.
  • Update .github/workflows/test.yml to remove the KengoTODA/actions-setup-docker-compose step — GitHub Actions ubuntu-latest runners include Docker 24+ with the compose plugin built in.
  • Add tests/test_compose_command.py with unit tests covering plugin-present, plugin-absent (non-zero exit, FileNotFoundError, TimeoutExpired), and caching behaviour.

Closes #35

Recommended reading order

  1. shard_core/util/subprocess.py — new compose_command() / _detect_compose_command()
  2. shard_core/service/app_tools.py — call-site updates
  3. Dockerfile — package list change
  4. .github/workflows/test.yml — CI step removal
  5. tests/test_compose_command.py — unit tests

🤖 Generated with Claude Code

Detect the compose command once at startup: prefer the plugin form
("docker compose") via "docker compose version", fall back to the
standalone "docker-compose" binary when the plugin is unavailable.

- shard_core/util/subprocess.py: add compose_command() with lru_cache detection
- shard_core/service/app_tools.py: replace all hard-coded "docker-compose" calls
- Dockerfile: drop standalone docker-compose APT package; Docker install provides the plugin
- .github/workflows/test.yml: remove KengoTODA action; runner's built-in plugin is used
- tests/test_compose_command.py: unit tests for detection and caching behaviour

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Use "docker compose" (v2) as a built-in plugin instead of standalone docker-compose

1 participant