crunchloop / crunchloop/devcontainer

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

Đang mở
#7 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area/engine enhancement limitation
Ngôn ngữ chính
Go
Star
5
Fork
0
Merge trung bình
6 giờ 17 phút
Pull request đã merge (30 ngày)
15

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.