Add platform-native local container CLI support#55249
Open
baronfel wants to merge 2 commits into
Open
Conversation
Prefer the Windows-native WSLC backend with Docker and Podman fallback, and add cached availability checks plus end-to-end coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0489bafc-54c5-404d-b5ca-bde9210d4df0
Prefer Apple's native container CLI on macOS, emit OCI archives for local loading, and add cached availability guards plus end-to-end coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0489bafc-54c5-404d-b5ca-bde9210d4df0
Contributor
|
Added When you commit this breaking change:
You can refer to the .NET SDK breaking change guidelines |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Containers feature area to prefer platform-native local container CLIs (Windows wslc, macOS container) ahead of Docker/Podman, adds explicit LocalRegistry types for them, and updates probing/load behavior and tests to match.
Changes:
- Add
WslcandContaineras explicit local registry types, and prefer them during local CLI detection (platform-gated). - Update local image load logic to use platform-native
image load --input <tar>syntax (and force OCI output when using Applecontainer). - Add/adjust unit + integration test gating and caching of availability probes.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs | Adds unit coverage for command selection, platform-gated probing, and platform-native load args/OCI forcing behavior. |
| test/Microsoft.NET.Build.Containers.UnitTests/DockerAvailableUtils.cs | Caches Docker/Podman probe results for test-process lifetime and avoids probing platform-native CLIs in these attributes. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs | Adds platform-gated E2E publish/load/run tests for WSLC and Apple container. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/DockerAvailableUtils.cs | Adds new platform-native availability conditions and caches probe results for the test process. |
| test/Microsoft.NET.Build.Containers.IntegrationTests/ContainerCli.cs | Switches CLI availability/podman detection to use cached status (Docker/Podman-focused). |
| src/Containers/packaging/build/Microsoft.NET.Build.Containers.targets | Updates LocalRegistry comment to include Docker/Podman/Wslc/Container. |
| src/Containers/Microsoft.NET.Build.Containers/Telemetry.cs | Adds telemetry classification for Wslc/Container (and Unknown) local storage types. |
| src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs | Centralizes manifest media type selection via ContainerBuilder.GetManifestMediaType(...). |
| src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net11.0/PublicAPI.Unshipped.txt | Adds new public constants for KnownLocalRegistryTypes.Wslc and .Container. |
| src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs | Adds Wslc/Container registry types and expands supported list + factory mapping. |
| src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs | Implements platform-native probing, selection preference, and file-based image load --input support. |
| src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs | Forces OCI manifest media type when destination local registry is Apple container. |
Comment on lines
+202
to
+205
| finally | ||
| { | ||
| temporaryDirectory.Delete(recursive: true); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wslcCLI and macOS' nativecontainerCLI before Docker or PodmanWslcandContainerlocal registry types with platform-specific readiness probes and fallbackcontainerFixes dotnet/sdk-container-builds#651
Fixes dotnet/sdk-container-builds#636
Testing
Microsoft.NET.Build.Containers.UnitTests: 281 total, 274 passed, 7 environment-gated skipsEndToEndWithWslcLocalLoad: passed on Windows with WSLCEndToEndWithAppleContainerLocalLoad: discovered and correctly skipped outside a configured macOS container environment