I tried this on my Windows 10 machine:
Dockerfile:
From microsoft/nanoserver CMD [\"echo\", \"Hello World\"]
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/