mirror of
https://github.com/microsoft/WSL.git
synced 2026-06-01 01:49:36 -05:00
* 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>