Doesn't work. Especially if, like me, you have a docking station usb 3 ethernet, an on-board ethernet, use wifi on many different access-points, and use your mobile phone for network connectivity.
The Docker daemon is started by running
$1
, which runs
$1
.
In that script, you'll see the “virtual switch” (
$1
) is used for networking – and that (at least in my case) appears to be bound to the ethernet I had when I installed.
Same pain point as trying to use Hyper-V VM's for roaming development.
Uninstalling Hyper-V leaves us in an interesting place:
$1
looks like the virtual switch made for containers was removed at some point (might have been when I installed Hyper-V, I'm not sure)
Running
$1
returns nothing.
So I installed VMWare Workstation and made a Boot2Docker VM with both NAT and private networking – both vmware based virtual networks continue to work when moving between wifi and ethernet.
So lets see if we can make one in powershell, using the VMWare NAT adaptor (see http://blogs.technet.com/b/heyscriptingguy/archive/2013/10/09/use-powershell-to-create-virtual-switches.aspx)
<
pre>
PS C:\Users\sven\src\WindowsDocker> Get-NetAdapter Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
—- ——————– ——- —— ———- ———
VMware Network Adapte…8 VMware Virtual Ethernet Adapter for … 28 Up 00-50-56-C0-00-08 100 Mbps
VMware Network Adapte…1 VMware Virtual Ethernet Adapter for … 27 Up 00-50-56-C0-00-01 100 Mbps
Wi-Fi Intel(R) Dual Band Wireless-AC 7260 4 Disabled 5C-51-4F-BA-12-6F 0 bps
Ethernet Intel(R) Ethernet Connection I218-LM 3 Up 28-D2-44-4D-B6-64 1 Gbps
VMWare helpfully provides a Virtual Network editor, so I can see that “Get-NetAdapter -Name “VMware Network Adapter VMnet8” is the NAT one. I'm not sure if creating a Hyper-V External vswitch will make exclusive use of the adaptor, but if so, we can always create another 🙂
$1
now to edit the runDockerDaemon.cmd, and restart the Docker Daemon.
FAIL. the docker containers still have no network. At this point, I'm not sure if I've totally broken my Windows Docker networking, hopefully some more playing later will turn up something.
Playing some more, there seems to be a new switchtype Nat – see https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/windows-server-container-tools/Install-ContainerHost/Install-ContainerHost.ps1
So re-running the command they use when installing gets us something new to try:
$1
it works when the ethernet is plugged in, but not on wifi.
yup – bleeding edge dev 🙂