Files
WSL/localization
Blue 3f47048189 Add support for anonymous port binds and --publish-all (#40288)
* Implement WSLCContainerFlagsPublishAll flag with CLI and tests

When the PublishAll flag is set, WSLCContainerImpl::Create() inspects the
container image to discover its ExposedPorts, creates TCP port mappings for
each exposed port that doesn't already have an explicit mapping, and uses
the resolved image ID for the container creation request to ensure the
same image is used.

CLI changes:
- Add --publish-all / -P flag to 'container create' and 'container run'
- Wire through ContainerOptions -> WSLCContainerFlagsPublishAll
- Add localization string for the new argument

Tests:
- PublishAllExposedPorts: builds an image with EXPOSE 8080 and 9090,
  verifies both ports get auto-mapped and the HTTP server is reachable
- PublishAllImageNotFound: verifies IMAGE_NOT_FOUND is returned when
  the flag is set with a nonexistent image

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Save state

* Prepare for PR

* Clean diff

* Cleanup diff

* Cleanup diff

* Apply PR feedback

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-23 18:38:57 -07:00
..