Skip to content

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

Description

@bilby91

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 <id> shows the binding

Activity

  1. added this to the v0.1.0 milestone on May 7, 2026
  2. removed this from the v0.1.0 milestone on May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engineEngine / public APIenhancementNew feature or requestlimitationKnown limitation; not a regression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions