sdk-container-builds icon indicating copy to clipboard operation
sdk-container-builds copied to clipboard

Support new macOS `container` tooling

Open baronfel opened this issue 7 months ago • 5 comments

macOS 26 introduced a new containerization technology that provides an alternative to the Docker Desktop for Mac ecosystem. We should support this tooling for .NET 10. This involves

The new tooling should

  • only be probed when on macOS
  • be lower-priority than the existing docker and podman probing for compatibility

The new tooling only supports OCI images, so a potential enhancement could be to force the use of OCI image format when this new tooling is detected.

baronfel avatar Jun 10 '25 14:06 baronfel

It's clear that container can only build OCI images, but can it still pull and run Docker image manifests?

(related: https://github.com/dotnet/dotnet-docker/issues/6148)

lbussell avatar Jun 10 '25 14:06 lbussell

@lbussell we should confirm, but I'm going off of:

  • this comment on the load CLI command
  • the implementation of imageStore.load which calls out OCI layout specifically

baronfel avatar Jun 10 '25 14:06 baronfel

I installed container on my Mac (which is running macOS 15.3.2, not the new beta). The existing .NET images seem to work just fine even though they are Docker images and not OCI images:

logan@Mac ~ % container --version
container CLI version 0.1.0 (build: release, commit: 0fd8692)
logan@Mac ~ % container run -i -t --rm mcr.microsoft.com/dotnet/sdk:8.0
root@53b68262-afb1-4b8e-8534-50e52b74b968:/# dotnet --list-sdks
8.0.411 [/usr/share/dotnet/sdk]

lbussell avatar Jun 12 '25 17:06 lbussell

Docker has been producing OCI images by default for a couple years now, so outside of images that haven’t been updated in years or specific edge cases where users have chosen to publish non-OCI images, the vast majority (including the dotnet images) should already be OCI format.

danegsta avatar Jun 14 '25 16:06 danegsta

Just to be precise, the .NET base images use application/vnd.docker.distribution.manifest.list.v2+json and application/vnd.docker.distribution.manifest.v2+json.

Examples:

  • Manifest list: https://oci.dag.dev/?image=mcr.microsoft.com%2Fdotnet%2Fruntime%3A8.0
  • Manifest: https://oci.dag.dev/?image=mcr.microsoft.com%2Fdotnet%2Fruntime%3A8.0-bookworm-slim-amd64

Whereas OCI images would use media types application/vnd.oci.image.index.v1+json and application/vnd.oci.image.manifest.v1+json respectively.

Further discussion about .NET base image format should go in https://github.com/dotnet/dotnet-docker/issues/6148 🙂

lbussell avatar Jun 19 '25 16:06 lbussell