nerdctl
nerdctl copied to clipboard
The container operating system does not match the host operating system.: unknown
Issue:
I am unable to run a Windows container nerdctl + containerd, using the following command:
nerdctl run -it hello-world:latest
When running the above command, I get the following error:
time="2022-01-28T04:05:51-08:00" level=fatal msg="failed to create shim: hcs::CreateComputeSystem 29e97983ef3a26e0f4d214059d65229c1ecf65c20686a2e2537d4eaf8a9e7ca5: The container operating system does not match the host operating system.: unknown"
Also, if I try using the following command to manually specify the platform type --platform windows/amd64
I get this slightly different error message:
time="2022-01-28T04:05:30-08:00" level=warning msg="Platform \"windows/amd64\" seems incompatible with the host platform \"windows/amd64\". If you see \"exec format error\", see https://github.com/containerd/nerdctl/blob/master/docs/multi-platform.md"
time="2022-01-28T04:05:32-08:00" level=fatal msg="failed to create shim: hcs::CreateComputeSystem fb3c289785a8ff2f3f71b018f689fa3eeae36ae1820c6b47eeb39053d0c561b3: The container operating system does not match the host operating system.: unknown"
If it helps, I noticed something weird when I run nerdctl.exe images
. When I run the command, it prints the container image twice for some reason:
Finally, for some additional information, here's the information I get back if I run nerdctl.exe info
:
PS C:\Users\Administrator> nerdctl.exe info
Client:
Namespace: default
Debug Mode: false
Server:
Server Version: v1.5.9
Storage Driver: windows
Logging Driver: json-file
Cgroup Driver:
Cgroup Version:
Plugins:
Log: json-file
Storage: windows-lcow windows
Security Options:
Kernel Version:
Operating System:
OSType: windows
Architecture:
CPUs: 0
Total Memory: 0B
Name: WIN-J0I7NK4V564
ID: 4855ff2e-67d5-4f2a-94da-a86773dec56d
Is there something I did wrong with setting up containerd, or is there something I need to configure with nerdctl? Any guidance would be greatly appreciated.
My Environment:
- OS: Windows Server 2019
- OS Version: 1809 (OS Build 17763.1282)
- CPU arch: Intel x86-64
- nerdctl version: v0.16.0
- containerd version v1.5.9
- Other information:
- Is the Windows Container feature enabled: Yes
- Is Hyper-v enabled: Yes, and I also tried with it uninstalled but I still encounter the same issue
This looks like it isn't parsing the manifest properly. Since you are on WS2019, could you try using hello-world:nanoserver-1809
directly?
confirmed nerdctl run -it hello-world:latest
is failing on WS2019 and nerdctl.exe run -it hello-world:nanoserver-1809
works. Also repo's on containerd 1.6
Haven't debugged but I think it maybe something in this area. Interestingly we are using a multi arch image in test suite
https://github.com/containerd/nerdctl/blob/2f0cf7586ed6763df2a6252d6f97d5512f8fc2f4/cmd/nerdctl/run.go#L626-L631
Nice! As you recommended nerdctl.exe run -it hello-world:nanoserver-1809
works for me as well. I guess it was partially my mistake of not using the correct image. But also, I'm guessing that the multi arch windows image also still should have worked. Is my understanding correct?
yes hello-world:latest
should work as it has a windows manifest for 1809:
(docker manifest inspect hello-world:latest -v | ConvertFrom-Json).Descriptor.platform."os.version"
10.0.20348.473
10.0.17763.2458
Tracked it down to https://github.com/containerd/containerd/blob/9c676e98dde995db46841a2c6126ad709e3fc7d7/platforms/platforms.go#L263
This is clearing out the OSVersion and is called with https://github.com/containerd/nerdctl/pull/448
The reason CI is passing is due to 1809 being the first in the manifest of the image being used with tests.
Multi arch is works with https://github.com/containerd/containerd/pull/6491
Damn, thanks for the lightening fast turnaround @jsturtevant ! 😀
It was a little more complicated than initially thought but I know have it working properly I think. See the containerd pr for details
the fix https://github.com/containerd/containerd/pull/6491 merged, once we pull in the latest containerd bits that have this fix this should be resolved.