[proxy] rewrite /etc/hosts from outside the container

Avoids problems when container user is non-root. Added a test for this
and the --no-rewrite-hosts flag.
This commit is contained in:
Paul Bellamy committed 2015-08-06 13:14:18 +01:00
1 parent 3180c67151
commit f55655216f
6 files changed
+172 -117

No files matched your search

+1 -5
View File
@@ -119,11 +119,7 @@ func (i *createContainerInterceptor) setWeaveWaitEntrypoint(container *docker.Co
}
if len(container.Entrypoint) == 0 || container.Entrypoint[0] != weaveWaitEntrypoint[0] {
entrypoint := weaveWaitEntrypoint
if i.proxy.NoRewriteHosts {
entrypoint = append(entrypoint, "-h")
}
container.Entrypoint = append(entrypoint, container.Entrypoint...)
container.Entrypoint = append(weaveWaitEntrypoint, container.Entrypoint...)
}
return nil