crunchloop / crunchloop/devcontainer

forwardPorts: actuate on image and build sources (currently informational)

未关闭
#7 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area/engine enhancement limitation
主要语言
Go
星标
5
派生
0
平均合并
6 小时 17 分钟
30 天内合并 PR
15

描述

Today `cfg.ForwardPorts` is parsed and surfaced in `ResolvedConfig` but never actuated. For image and build sources we should add `PortBindings` to the run spec so a user's `forwardPorts: [3000]` actually exposes the port on the host.

Compose source stays informational by design (compose has its own `ports:` directive; design/compose.md §10.3 / decision §10.3 in compose design doc).

### Plan

- Extend `runtime.RunSpec` with `PortBindings []PortBinding`
- Map `ResolvedConfig.ForwardPorts` → `HostConfig.PortBindings` for image / build sources in `buildRunSpec`
- Honor `PortsAttributes.OnAutoForward` for the bind shape (`notify` vs `silent`)
- Default to `Host: 0` (any free host port) when caller didn't specify; document
- Test: end-to-end integration against image source + a port; assert `docker port ` shows the binding

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。