Closed patagona-afriemann closed 8 years ago
Thanks for opening this issue @patagona-afriemann! I wasn't aware of Docker not setting the top level IPAddress
field. Patching this should be simple enough, I'll open a pull request and tag you on it so that you can test it out.
Pull request: https://github.com/swipely/iam-docker/pull/7
Merged #7 yesterday and validated it locally. Going to close this issue -- feel free to reopen if it's not resolved.
Running containers with custom networks will result in the IPAddress field being empty
which in turn will result in iam-docker not being able to find the container
Debug output shows the IP is clearly not set when creating the config in docker/container_store.go, line 171. As stated in https://github.com/docker/docker/issues/21658 the toplevel IPAddress will only be set for the default bridge device.
Our current use case is a docker swarm. This makes it practically impossible to use iam-docker with docker-compose files and overlay networks.
I propose an additional label to set the network interface and request the IPAddress from the specified interface instead of the toplevel IPAddress field, probably with a fallback to "bridge".
p.s. I might be able to supply a patch until next week, however I never worked with go and would be happy to accept another solution instead.