[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:
1 parent
3180c67151
commit
f55655216f
6 files changed
+172
-117
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user