Problem: The company has a closed Windows Server and wants to take advantage of it, but it cannot communicate successfully after the container has been started.
Study:
1. Discover that the installation package contains VirtualBox, and then suspect that Docker under Windows ran a Docker virtual machine in VirtualBox (for extra thought, the container you built is running in VirtualBox Docker, Is there a layer of direct running in Docker with Linux? Is there a loss in performance? )
2. Start VirtualBox, and sure enough, there is a new and running virtual machine
3. Try to modify: Add a forward in the virtual network card
Note that I erase the host IP portion, if you only want to access the machine to fill 127.0.0.1 can, if there is an external network address needs to be bound to the external network network card, otherwise the extranet access can not be reached.
4. Boot container: Docker run-i-t-p-D 49223:22 Mycentos/bin/bash
5. Using SSH to access the container outside successfully
A summary of the reasons for this problem: if we see a 49226-to-22 mapping, this is automatically added when you install Docker on Windows. So to confirm my above speculation, Docker on Windows is actually a virtual machine run on VirtualBox, which is operated by SSH automatic login. Will there be a loss of performance and can the stability of VirtualBox support the business? Of course, we can build a centos on the hype-v, open ssh to the outside, but only when the server is Windows and the "leader" is unwilling or unable to turn to Linux.
For students who want to try Docker in Windows
Troubleshooting Docker on Windows network not through