Add hosts when attaching

This commit is contained in:
Alvaro Saurin committed 2015-10-16 11:47:07 +02:00
1 parent 0d165487b8
commit 6a674d0d67
1 file changed
+6
+6
View File
@@ -356,6 +356,12 @@ func (proxy *Proxy) attach(container *docker.Container) error {
args = append(args, cidrs...)
if !proxy.NoRewriteHosts {
args = append(args, "--rewrite-hosts")
if container.HostConfig != nil {
for _, eh := range container.HostConfig.ExtraHosts {
args = append(args, fmt.Sprintf("--add-host=%s", eh))
}
}
}
args = append(args, "--or-die", container.ID)
if _, stderr, err := callWeave(args...); err != nil {