Fail to start tasks/services in Docker Swarm: hnsCall failed in Win32: The parameter is incorrect

I am trying the Docker Get Started tutorial, Part 3 (Services). So the part where I need to init a swarm and deploy a stack, all my service status is rejected:

enter image description here

The full error (using --no-trunc) is:

hnsCall failed in Win32: The parameter is incorrect. (0x57)

Here are the steps I am doing:

  • Ensure my image is correct (the docker run works well, I accessed localhost:4000 successfully). Then I stopped the container to make sure it does not interfere.

  • When I init the swarm, it says I have multiple addresses, so I chose a random one (I tried with either of them, same result) using --advertise-addr.

  • docker stack deploy works, but when I check the status with docker service ps, none of them are up. localhost:4000 has no listener.

  • Note: I switched Docker to a Windows container.

I am new to Docker and this is beyond me. Can anyone please suggest a solution/debug way?