updated
The app is up. The Mac has nothing on :3000.
dc-forward reconciles owned sidecars (one app or --id). --take-ports stops labeled holders only; unlabeled is report-only.
dc-up starts .devcontainer/docker-compose.yml. That file often has no 3000:3000. The app listens inside; the Mac has nothing on :3000.
dc-forward reconciles owned alpine/socat sidecars on the Docker network. Host socat → 172.x does not work on Colima. Identity is the host+container pair (so 9001:80 stays asymmetric). Requires exactly one labeled app or --id. Any requested mapping that cannot be ensured fails the command (and dc-up after a successful start).
dc-forward # reconcile compose `app.ports` + forwardPorts
dc-forward 3000
dc-forward 9001:80
dc-forward --status
dc-forward --stop
dc-up runs this after a successful start (--no-forward / DC_FORWARD=0 skips). dc-down removes workspace-owned sidecars.
dc-db does not change that wanted set. It follows the host port you already wrote on the db service. If that pair is unpublished, it runs dc-forward --id $db HOST:CONTAINER (the db, not the app). No declared map → refuse. It never invents a port and never --take-ports.
dc-up --ports is not “add 3000”. It replaces the whole devcontainer.json.
Host port already allocated
Two projects can publish the same host port (for example both wordpress-mitm on 9001). Compose then fails.
dc-up
# dc-up: host port conflict
# ports: 9001
# holders:
# d11b00f0880b other-project-wordpress-mitm-1 compose=other
# Stop the holder(s) above and retry dc-up for this folder? [y/N]
| Mode | Behavior |
|---|---|
| TTY | lists holder → ask y/N → stop labeled foreign holders → retry once |
dc-up --create-nets |
create missing declared external: true nets as a default bridge (does not take ports) |
dc-up --take-ports / --yes |
same without prompt; only positively labeled foreign stacks/sidecars. --yes also creates missing nets |
| non-TTY without flag | lists holder + how to re-run; does not stop |
Stops other labeled workspaces only. Unlabeled, ambiguous, or inspect-unknown holders are report-only — they are not stopped. Prefer stopping a sibling stack over editing project compose ports.
Flags: dc up --help and dc forward --help.
FAQ
- Does Zed publish app ports?
- No. Zed Dev Containers do not support forwardPorts. dc-up already runs dc-forward. Attach in Zed after that (Project: Open Remote → Connect Dev Container).
Broke something?report it