Skip to content

fix(scripts): detect docker compose v2 in download_db.sh - #202

Open
dkijania wants to merge 1 commit into
mainfrom
fix/download-db-compose-v2
Open

fix(scripts): detect docker compose v2 in download_db.sh#202
dkijania wants to merge 1 commit into
mainfrom
fix/download-db-compose-v2

Conversation

@dkijania

Copy link
Copy Markdown
Contributor

What & why

scripts/download_db.sh hardcodes docker-compose stop postgres — the Compose v1 binary, EOL since 2023 and absent on v2-only hosts. But docs/getting-started.md (Path C) tells users to run docker compose up (v2). So on a v2-only machine the documented setup works right up until download_db.sh, which then fails with docker-compose: command not found.

This detects whichever Compose is installed — preferring v2 — and errors clearly if neither is present.

Provenance

This is the one salvageable hunk from #125 (Staketab). Per the review there, its other two files (.env.example.compose, scripts/generate_libp2p.sh) now conflict with #158's mainnet-3.3.1 refresh and are best dropped, so this lands the real improvement on a clean branch off main. Closes #125's useful part; recommend closing that PR once this merges.

Testing

  • shellcheck scripts/download_db.sh — clean
  • bash -n — clean
  • Simulated a v2-only host (docker present, docker-compose absent): detection resolves to docker compose and reaches stop postgres. Simulated a v1-only host: resolves to docker-compose. Missing-both: exits 1 with a clear message.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ACRnT8ZHiAqEhusugky6fu

download_db.sh hardcoded `docker-compose` (Compose v1), which is EOL since
2023 and not present on v2-only hosts — yet docs/getting-started.md tells
users to run `docker compose up` (v2). So the documented setup failed here
with "command not found". Detect whichever is installed, preferring v2,
and error clearly if neither is.

Salvaged from #125 (Staketab), whose other two files now conflict with
#158's mainnet-3.3.1 refresh; this is the piece still worth landing.

Verified: shellcheck clean, and the detection resolves to `docker compose`
on a v2-only host (docker present, docker-compose absent).

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant