Skip to content

Add platform-native local container CLI support#55249

Open
baronfel wants to merge 2 commits into
dotnet:mainfrom
baronfel:baronfel-windows-container-tooling
Open

Add platform-native local container CLI support#55249
baronfel wants to merge 2 commits into
dotnet:mainfrom
baronfel:baronfel-windows-container-tooling

Conversation

@baronfel

Copy link
Copy Markdown
Member

Summary

  • prefer Windows' native wslc CLI and macOS' native container CLI before Docker or Podman
  • add explicit Wslc and Container local registry types with platform-specific readiness probes and fallback
  • load native-tool archives using their supported command syntax and force OCI image output for Apple container
  • cache Docker, WSLC, and Apple container availability checks across tests
  • add unit coverage and platform-gated end-to-end publish/load/run tests

Fixes dotnet/sdk-container-builds#651
Fixes dotnet/sdk-container-builds#636

Testing

  • Microsoft.NET.Build.Containers.UnitTests: 281 total, 274 passed, 7 environment-gated skips
  • EndToEndWithWslcLocalLoad: passed on Windows with WSLC
  • EndToEndWithAppleContainerLocalLoad: discovered and correctly skipped outside a configured macOS container environment

baronfel added 2 commits July 11, 2026 13:49
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
Copilot AI review requested due to automatic review settings July 11, 2026 19:05
@baronfel baronfel requested a review from a team as a code owner July 11, 2026 19:05
@baronfel baronfel requested review from lbussell and mthalman July 11, 2026 19:07
@baronfel baronfel added Area-Containers Related to dotnet SDK containers functionality breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug labels Jul 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET SDK Breaking Change Notification email list.

You can refer to the .NET SDK breaking change guidelines

@baronfel baronfel assigned baronfel and unassigned mthalman and lbussell Jul 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Wslc and Container as 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 Apple container).
  • 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Containers Related to dotnet SDK containers functionality breaking-change Using this label will notify dotnet/compat and trigger a request to file a compat bug needs-breaking-change-doc-created

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support new Windows container tooling Support new macOS container tooling

4 participants