2

I found this: Assign static IP to Docker container and a few blog articles that sort of do this on Linux. However I cannot find any documentation on this for Windows.

Basically, I want to force Docker to send all outgoing traffic (and responses) from the containers I specify through a specific IP assigned to the host computer (not the default) This traffic needs to be routed properly by our Router so I need the IP address.

I also don't want it to be bound to all IPs or the default IP for incoming traffic, I want to bind it to the specific IP address.

I cannot find any (windows especially) documentation on how to configure what IP a docker container should use. Obviously port is straight forward to map, bug IP doesn't appear to be.

Anyone have any suggestions on how to force Docker (community or EE on Windows 2019 Server beta) to bind to the specific IP?

Update: It appears that this might be possible using docker network create however I can't make docker cc with Linux containers create a transparent or l2bridge because it says that the plugin isn't found. How does one convince it to create a transparent network with Linux containers in docker for windows?

James Hancock
  • 3,348
  • 5
  • 34
  • 59
  • Right. So how do I get it so docker sends the containers traffic on say 10.0.0.5 instead of 10.0.0.2? – James Hancock Jun 01 '18 at 18:54
  • https://learn.microsoft.com/en-us/virtualization/windowscontainers/container-networking/network-drivers-topologies – Gregory Suvalian Jun 01 '18 at 18:55
  • 1
    Using this: docker network create -d l2bridge --subnet="192.168.1.0/24" --gateway="192.168.1.1" MyContainerOverlayNetwork from the documentation I get error response from daemon: plugin "l2bridge" not found. Transparent results in the same. only "bridge" works and when I run a container against that network it gets a 172.xx.xx.xx address not assigned by our DHCP. – James Hancock Jun 01 '18 at 19:19
  • Doesn't work on Windows 10 1803 with latest edge release of docker community nor Windows 2016 with docker community. (not ee because it doesn't support Linux vms obviously) – James Hancock Jun 01 '18 at 19:23
  • I did not realize it's Linux containers being referenced. Outside of my area. – Gregory Suvalian Jun 01 '18 at 19:25

0 Answers0