How can a .net core web app docker image run on Mac OS?

How can a .net core web app docker image run on Mac OS?

Short Answer:

Because .NET Core is cross-platform. And docker works on Mac and Windows (theoretically just the way it works on Linux) the image will work just fine on any platform.

mcr.microsoft.com/dotnet/core/sdk:3.1 is platform dependent. Depending on the architecture you choose to run Docker itll pick up Windows Nano server or Linux template.

Long Answer:

Docker is not a VM technology. Its a Linux feature that provides you an isolated environment. Docker is not possible on Windows and Mac.
Docker uses Linux features and plugs in an application (and its related dependencies) in the Linux environment and creates an illusion of resources (network, RAM, disk, software frameworks) needed for running the application.

On windows and Mac. Docker installs a Linux VM. And runs the Docker infra inside the VM.

commands like docker info will give more details. This picture below shows that its running on Linux.

enter

Switching to Windows docker will give a different output for docker info command.

enter

How can a .net core web app docker image run on Mac OS?

Leave a Reply

Your email address will not be published.