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.
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.