Some modifications in C:\Program Files\Docker\Docker\resources\MobyLinux.ps1 to have MobyLinux use an External switch attached to the network adapter. See this post.
Linux container (centos) started with network=host
With this setup:
I got a Linux container in the same LAN as Windows host, with IP 169.254.0.2
I can ping Linux from Windows and reversely.
I can share a directory.
But if I create a second container with the same image, I got the same IP 169.254.0.2.
How can I change that ? Which rule is used by the engine to set this IP address ?
Thanks for help.
Yes I am !
When I do ip addr inside my container, I got the IP 169.254.0.2 which is in the same subnetwork as the host but with a different IP address.
That suits my needs for this first container but not for the second which get the same IP as the first. I would like that the second get the IP 169.25.0.3 for example.
Ok, even if I don’t understant the logic behind that.
I would understand the logic if my container got the same IP as the host but the fact is that it didn’t got the same.
Is the IP 169.254.0.2 is depending on a docker-machine which would handle both containers ?
Thanks a lot for your patience !
On Hyper-V containers are not run nativly on your host, but on a “remote” docker engine inside a linux vm. So the ip you see is the host ip of that particular “host” vm that runs the docke engine.
You expect the linux vm to claim the host windows ip…
Tanks for this answer which clarify my comprehension.
A last question : do you think it is possible for Hyper-V to start a second “particular host" (as you said) and start a linux container with it ? Hoping this way that I could have that container having another IP ?