Skip to content

Add macOS container CLI support for local container publishing#54643

Closed
baronfel with Copilot wants to merge 5 commits into
mainfrom
copilot/support-new-macos-container-tooling
Closed

Add macOS container CLI support for local container publishing#54643
baronfel with Copilot wants to merge 5 commits into
mainfrom
copilot/support-new-macos-container-tooling

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

macOS now has a native container CLI that can act as a local image store alongside Docker and Podman. This updates local-registry publishing to recognize that CLI, prefer existing runtimes first, and use an OCI-compatible load path when container is selected.

  • Local registry support

    • adds KnownLocalRegistryTypes.Container
    • wires CreateLocalRegistry to instantiate the local daemon wrapper for container
    • updates public API baselines for the new local registry type
  • Daemon detection

    • probes container only on macOS
    • keeps detection priority as:
      1. Docker
      2. Podman
      3. container
    • preserves the existing Docker-vs-Podman alias handling before considering container
  • Local image loading

    • adds container CLI handling to DockerCli
    • uses container image load --input <archive> instead of streaming to docker load
    • writes a temp OCI tarball for the container path, since the CLI expects a file input
  • Image format selection

    • forces OCI manifest output when targeting the macOS container local registry
    • keeps existing Docker/Podman behavior unchanged
  • Related updates

    • extends local-storage telemetry to distinguish container
    • updates daemon-test helpers so Docker-only tests skip non-Docker local CLIs
    • adds focused unit coverage for command selection, registry creation, and OCI format forcing
internal static bool ShouldForceOciImageFormat(DestinationImageReference destinationImageReference)
    => destinationImageReference.LocalRegistry is DockerCli dockerCli
        && dockerCli.GetCommand() == DockerCli.ContainerCommand;

Copilot AI and others added 3 commits June 8, 2026 15:51
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for new macOS container tooling in .NET 10 Add macOS container CLI support for local container publishing Jun 8, 2026
Copilot AI requested a review from baronfel June 8, 2026 16:05
"symbols/ExtensionsProfile/choices/None/displayName": "Žádné",
"symbols/ExtensionsProfile/choices/AllMicrosoft/description": "Povolit všechna rozšíření odeslaná Microsoftem (včetně rozšíření s omezující licencí)",
"symbols/ExtensionsProfile/choices/AllMicrosoft/displayName": "AllMicrosoft",
"symbols/ExplicitProgramFile/description": "When using Microsoft.Testing.Platform, generate an explicit Program.cs file with the test application entry point instead of relying on the entry point auto-generated by the SDK. Has no effect when TestRunner is VSTest.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot remove all of these localization changes, they are unrelated to this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed in e5ac924.

Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Copilot AI requested a review from baronfel June 8, 2026 16:53
@baronfel baronfel marked this pull request as ready for review June 8, 2026 17:09
Copilot AI review requested due to automatic review settings June 8, 2026 17:09
@baronfel baronfel requested a review from a team as a code owner June 8, 2026 17:09

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 Microsoft.NET.Build.Containers local-daemon publishing to support the new macOS-native container CLI as an additional local image store option alongside Docker and Podman, including detection/selection logic, load behavior, and OCI format forcing when targeting container.

Changes:

  • Adds a new local registry type (KnownLocalRegistryTypes.Container) and wires registry creation to a DockerCli wrapper configured for the container command.
  • Extends local CLI detection/selection priority (Docker → Podman → container on macOS) and adds container-specific load behavior (container image load --input <tar>).
  • Forces OCI manifest output when publishing to the container local registry and extends telemetry/tests accordingly.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs Updates daemon-test skip commentary to include container as a local-only CLI.
test/Microsoft.NET.Build.Containers.UnitTests/DockerCliTests.cs Adds unit tests for CLI selection priority, registry creation for Container, and OCI forcing behavior.
test/Microsoft.NET.Build.Containers.UnitTests/DockerAvailableUtils.cs Updates Docker-availability test attributes to skip non-Docker CLIs and maps container to the new local registry type.
src/Containers/Microsoft.NET.Build.Containers/Telemetry.cs Adds Container to local storage telemetry classification.
src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs Consolidates image format parsing and delegates manifest media-type selection to ContainerBuilder.
src/Containers/Microsoft.NET.Build.Containers/PublicAPI/net11.0/PublicAPI.Unshipped.txt Records the new KnownLocalRegistryTypes.Container public constant.
src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs Introduces the Container local registry type and includes it in supported types and factory creation.
src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs Adds container command support: probing on macOS, selection logic, and an OCI-tar-file load path using --input.
src/Containers/Microsoft.NET.Build.Containers/ContainerBuilder.cs Adds centralized media-type selection helpers and forces OCI manifest type for container local publishing.

Comment on lines 18 to 26
if (!DockerCliStatus.IsAvailable)
{
base.Skip = "Skipping test because Docker is not available on this host.";
}

if (skipPodman && DockerCliStatus.Command == DockerCli.PodmanCommand)
if (skipPodman && DockerCliStatus.Command != DockerCli.DockerCommand)
{
base.Skip = $"Skipping test with {DockerCliStatus.Command} cli.";
}
Comment on lines +23 to 26
if (skipPodman && DockerCliStatus.Command != DockerCli.DockerCommand)
{
base.Skip = $"Skipping test with {DockerCliStatus.Command} cli.";
}
Comment on lines +173 to +176
finally
{
File.Delete(imageArchivePath);
}
@baronfel

Copy link
Copy Markdown
Member

Closing in favor of #55249

@baronfel baronfel closed this Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support new macOS container tooling

3 participants