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.
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.