Skip to content

Commit b7f8bf5

Browse files
authored
Add devcontainer-bridge (dbr) for dynamic port forwarding (#13)
* Add devcontainer-bridge (dbr) for VS Code-independent port forwarding forwardPorts in devcontainer.json is a no-op outside VS Code. dbr provides dynamic port auto-discovery via /proc/net/tcp polling and forwards to the host via reverse TCP connections. Container daemon is inert without the host daemon, so VS Code users are unaffected. * Fix 3 CodeRabbit issues + stale doc reference - CHANGELOG: add #### Features sub-heading, rewrite bullet as user-facing - CLAUDE.md: forwardPorts is static, not dynamic discovery - CLAUDE.md: fix Claude Code version ref (:1 → :1.0.5) - devcontainer.json: pin dbr to 0.2.0 instead of :latest --------- Co-authored-by: AnExiledDev <AnExiledDev@users.noreply.github.com>
1 parent 4b0b63b commit b7f8bf5

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.devcontainer/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
- **`/ship`** — Combined commit/push/PR command with full code review, commit message approval, and AskUserQuestion confirmation before PR creation; optionally links to tickets if context exists
1818
- **`/pr:review`** — Review any PR by number/URL or auto-detect from current branch; posts findings as PR comment with severity ratings; never approves or merges
1919

20+
#### Features
21+
- **devcontainer-bridge (dbr)** — Ports opened inside the container are now automatically discovered and forwarded to the host, even outside VS Code. Requires `dbr host-daemon` running on the host. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge)
22+
2023
### Changed
2124

2225
#### Skill Engine: Auto-Suggestion

.devcontainer/CLAUDE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ git worktree add /workspaces/projects/.worktrees/<branch-name> -b <branch>
7373
| `agent-browser` | Headless Chromium (Playwright-based) |
7474
| `check-setup` | Verify CodeForge setup health |
7575
| `claude-dashboard` | Session analytics dashboard (port 7847) |
76+
| `dbr` | Dynamic port forwarding (devcontainer-bridge) |
7677
| `cc-tools` | List all installed tools with versions |
7778

7879
## Plugins
@@ -175,3 +176,14 @@ Labels are `custom-text` widgets with `merge: "no-padding"` so they fuse visuall
175176
## Features
176177

177178
Custom features in `./features/` follow the [devcontainer feature spec](https://containers.dev/implementors/features/). Every local feature supports `"version": "none"` to skip installation. Claude Code is installed as a native binary via `./features/claude-code-native` (uses Anthropic's official installer at `https://claude.ai/install.sh`).
179+
180+
## Port Forwarding
181+
182+
Two mechanisms handle port access:
183+
184+
| Mechanism | When Active | Dynamic Discovery |
185+
|-----------|-------------|-------------------|
186+
| `forwardPorts` (devcontainer.json) | VS Code / Codespaces only | No (static list; VS Code auto-detects separately) |
187+
| devcontainer-bridge (`dbr`) | Any terminal client | Yes (polls `/proc/net/tcp`) |
188+
189+
`forwardPorts` is a no-op outside VS Code — the `devcontainer` CLI ignores it. `dbr` provides VS Code-independent dynamic port discovery via a reverse connection model (container→host). The container daemon auto-starts and is inert without the host daemon (`dbr host-daemon`). Both mechanisms coexist. See [devcontainer-bridge](https://github.com/bradleybeddoes/devcontainer-bridge).

.devcontainer/devcontainer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
// npm-dependent features (agent-browser, ccusage, ccburn, claude-session-dashboard,
5050
// biome, lsp-servers) must come after Node. uv-dependent features (ruff, claude-monitor) must
5151
// come after uv. cargo-dependent features (ccms) must come after Rust.
52-
// notify-hook is last (lightweight, no dependencies).
52+
// notify-hook is second-to-last (lightweight, no dependencies).
53+
// dbr (devcontainer-bridge) is last — standalone binary, no dependencies.
5354
"overrideFeatureInstallOrder": [
5455
"ghcr.io/devcontainers/features/node",
5556
"ghcr.io/devcontainers/features/github-cli",
@@ -77,7 +78,8 @@
7778
"./features/shellcheck",
7879
"./features/hadolint",
7980
"./features/biome",
80-
"./features/notify-hook"
81+
"./features/notify-hook",
82+
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr"
8183
],
8284

8385
"features": {
@@ -147,7 +149,8 @@
147149
"./features/notify-hook": {
148150
"enableBell": true,
149151
"enableOsc": true
150-
}
152+
},
153+
"ghcr.io/bradleybeddoes/devcontainer-bridge/dbr:0.2.0": {}
151154
},
152155

153156
"forwardPorts": [7847],

0 commit comments

Comments
 (0)