mirror of https://github.com/docker/docs.git
Copy values out of hostConfig
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael) Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: vieux)
This commit is contained in:
parent
2c185e25c2
commit
4e12484ea1
|
@ -422,8 +422,17 @@ func (container *Container) allocateNetwork() error {
|
||||||
if container.Config.ExposedPorts != nil {
|
if container.Config.ExposedPorts != nil {
|
||||||
portSpecs = container.Config.ExposedPorts
|
portSpecs = container.Config.ExposedPorts
|
||||||
}
|
}
|
||||||
|
|
||||||
if container.hostConfig.PortBindings != nil {
|
if container.hostConfig.PortBindings != nil {
|
||||||
bindings = container.hostConfig.PortBindings
|
for p, b := range container.hostConfig.PortBindings {
|
||||||
|
bindings[p] = []nat.PortBinding{}
|
||||||
|
for _, bb := range b {
|
||||||
|
bindings[p] = append(bindings[p], nat.PortBinding{
|
||||||
|
HostIp: bb.HostIp,
|
||||||
|
HostPort: bb.HostPort,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
container.NetworkSettings.PortMapping = nil
|
container.NetworkSettings.PortMapping = nil
|
||||||
|
|
Loading…
Reference in New Issue