Merge pull request #448 from raymondelooff/bugfix/188

Unset Hostname when NetworkMode is container
pull/449/head
Simon Aronsson 5 years ago committed by GitHub
commit bd1b3c1c89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -138,6 +138,7 @@ func (c Container) StopSignal() string {
// the options overridden at runtime.
func (c Container) runtimeConfig() *dockercontainer.Config {
config := c.containerInfo.Config
hostConfig := c.containerInfo.HostConfig
imageConfig := c.imageInfo.Config
if config.WorkingDir == imageConfig.WorkingDir {
@ -148,6 +149,10 @@ func (c Container) runtimeConfig() *dockercontainer.Config {
config.User = ""
}
if hostConfig.NetworkMode.IsContainer() {
config.Hostname = ""
}
if util.SliceEqual(config.Cmd, imageConfig.Cmd) {
config.Cmd = nil
}

Loading…
Cancel
Save