mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 04:31:28 +00:00
Update container resolv.conf when host network changes /etc/resolv.conf
Only modifies non-running containers resolv.conf bind mount, and only if the container has an unmodified resolv.conf compared to its contents at container start time (so we don't overwrite manual/automated changes within the container runtime). For containers which are running when the host resolv.conf changes, the update will only be applied to the container version of resolv.conf when the container is "bounced" down and back up (e.g. stop/start or restart) Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
This commit is contained in:
@@ -290,14 +290,6 @@ func NewHTTPRequestError(msg string, res *http.Response) error {
|
||||
}
|
||||
}
|
||||
|
||||
var localHostRx = regexp.MustCompile(`(?m)^nameserver 127[^\n]+\n*`)
|
||||
|
||||
// RemoveLocalDns looks into the /etc/resolv.conf,
|
||||
// and removes any local nameserver entries.
|
||||
func RemoveLocalDns(resolvConf []byte) []byte {
|
||||
return localHostRx.ReplaceAll(resolvConf, []byte{})
|
||||
}
|
||||
|
||||
// An StatusError reports an unsuccessful exit by a command.
|
||||
type StatusError struct {
|
||||
Status string
|
||||
|
||||
Reference in New Issue
Block a user