I have recently tried to pull and run a Docker image (that worked on Windows 10) on a Windows Server 2019 instance which failed with the following error message:
The container operating system does not match the host operating system.
I've tried it on the latest version of Windows Server Core
and Nano Server
from the normal microsoft/windowsservercore
and microsoft/nanoserver
repositories.
I don't understand because those are Windows Kernels running on a Windows Operating System.
Running Linux Containers on Windows Server 2019 Out of the box, Docker on Windows only run Windows container. To use Linux containers on Windows Server, you need to use the Docker Enterprise Edition Preview which includes a full LinuxKit system for running Docker Linux containers.
On Windows Server 2016, Docker and Microsoft came out with container technology that provided a consistent experience across both Linux and Windows Server environments. In 2017, they released Docker Swarm with the ability to create mixed Windows Server and Linux clusters.
You can run any application in Docker as long as it can be installed and executed unattended, and the base operating system supports the app. Windows Server Core runs in Docker which means you can run pretty much any server or console application in Docker.
To run Windows containers, you need Windows 10 or Windows 11 Professional or Enterprise edition. Windows Home or Education editions will only allow you to run Linux containers.
Based on the feedback given on this github issue you have to pull the repository from Microsoft's new Container Registry (mcr.microsoft.com) for a specific version (1809). This version is compatible with Windows Server 2019.
docker pull mcr.microsoft.com/windows/servercore:1809
docker pull mcr.microsoft.com/windows/nanoserver:1809
Also beware that nanoserver
no longer has Power-Shell in its base image.
As for why this is happening, I am not sure. Would appreciate if anyone could shed some light on the subject.
This error appears because Windows 10 and Windows Server have different Isolation Modes: Hyper-V Isolation for Win 10 and Process Isolation for Win Server. You can find more here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With