Docker - image operating system “windows” cannot be used on this platform

后端 未结 5 1316
猫巷女王i
猫巷女王i 2021-01-30 12:16

I tried this on my Windows 10 machine:

Dockerfile:

From microsoft/nanoserver
CMD [\"echo\", \"Hello World\"]


        
相关标签:
5条回答
  • 2021-01-30 12:39

    Switch to Windows Container needs to selected from docker icon running under hidden icon from the bottom right... The moment you switch from Linux to Windows or Windows to Linux, Docker daemon automatically restarts to consider switched container...


    I would highly recommend you to view these 2 links to get more insight into how to create window containers:

    • Forum post

    • Blog post


    I really found the content of these links very helpful to make a window container which is still being enhanced for the generic issue we are all are facing since support for window container is yet to mature like Linux containers!

    0 讨论(0)
  • 2021-01-30 12:48

    Your Docker host is configured to run Linux containers inside of a VM. To run Windows containers, you need to "Switch to Windows containers" in the Docker menu. Documentation on that is available here.


    0 讨论(0)
  • 2021-01-30 12:48

    Not just Windows 10 required. I have Windows 10 Home and the menu has "Change to Windows Containers" greyed out. THe hover popup says it requires Win10 PRO or Enterpriose build >= 14372

    0 讨论(0)
  • 2021-01-30 12:58

    You need to go to the Taskbar → right click the Docker icon → use option Switch to Windows containers...

    Source https://docs.docker.com/docker-for-windows/

    0 讨论(0)
  • 2021-01-30 13:01

    microsoft/nanoserver is a windows native container image. So you cannot run this as linux containers run natively. It can only be run on windows 10 or windows server.

    If you are in windows 10, you can switch to windows containers by selecting

    switch to windows containers

    0 讨论(0)
提交回复
热议问题