Show HN: Coasts – 에이전트를 위한 컨테이너화된 호스트
Source: Hacker News
Hi HN – we’ve been working on Coasts (“containerized hosts”) to let you run multiple localhost instances and multiple docker‑compose runtimes across Git worktrees on the same computer.
Demo
- Video demo:
- Conceptual overview videos (in the docs):
Why Coasts?
Agents can make code changes in different worktrees in isolation, but testing those changes requires isolated localhost runtimes scoped to the same worktrees. Port‑hacking tricks work only up to a point; they become impractical with complex docker‑compose setups that have many services and volumes.
What Is a Coast?
A containerized host (or “coast”) is a representation of your project’s runtime—similar to a devcontainer but without IDE tooling, focusing solely on the runtime environment.
- Add a
Coastfileat the project root, typically pointing to the project’sdocker‑compose.yml. - Run
coast buildnext to theCoastfile. This builds a Docker image that can spin up multiple Docker‑in‑Docker runtimes of the project.
Assigning a Coast to a Worktree
coast assign dev-1 -w worktree-1
The command binds the coast to the worktree-1 root. Under the hood:
- The host project root and any external worktree directories are bind‑mounted into the container at creation time.
- The
/workspacedirectory (where the coast’s services run) is a separate Linux bind mount created inside the running container. - Switching worktrees involves unmounting
/workspace, rebinding it to the new worktree, and usingmount --make-rshared /workspaceso the change propagates to the inner Docker daemon’s containers.
Working with Coasts
- Host‑side development: Agents continue to work on the host filesystem.
- Runtime testing: Agents can execute commands against a specific coast instance, e.g.,
coast exec dev-1 make tests. - Dynamic ports: Each coast defines ports to expose back to the host in the
Coastfile. When you “checkout” a coast,socatbinds the canonical ports (e.g., web 3000, db 5432) to the host, useful for hard‑coded ports or webhook testing.
Configuration Highlights
- Worktree locations: Specify host directories where worktrees are stored (e.g.,
~/.codex/worktrees) in theCoastfile. - Volume topologies: Omit services/volumes an agent doesn’t need, or share certain services host‑side to reduce overhead.
- Service strategies: Define how each service behaves after a worktree assignment change (
none,hot,restart,rebuild) to avoid fulldocker‑compose down/upcycles.
Feedback
We’d love to answer any questions and hear your feedback!