crunchloop / crunchloop/devcontainer

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

Ouverte
#7 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area/engine enhancement limitation
Langage dominant
Go
Étoiles
5
Forks
0
Merge moyen
6 h 17 min
PR mergées (30 j)
15

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.