mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 22:20:12 +01:00
Refactor port mapping functions for build simplicity
This commit is contained in:
parent
e75236414e
commit
6a56597d45
3 changed files with 7 additions and 13 deletions
|
|
@ -136,7 +136,12 @@ func (c Container) runtimeConfig() *dockercontainer.Config {
|
|||
|
||||
config.Volumes = structMapSubtract(config.Volumes, imageConfig.Volumes)
|
||||
|
||||
config.ExposedPorts = structMapPortSubtract(config.ExposedPorts, imageConfig.ExposedPorts)
|
||||
// subtract ports exposed in image from container
|
||||
for k, _ := range config.ExposedPorts {
|
||||
if _, ok := imageConfig.ExposedPorts[k]; ok {
|
||||
delete(config.ExposedPorts, k)
|
||||
}
|
||||
}
|
||||
for p := range c.containerInfo.HostConfig.PortBindings {
|
||||
config.ExposedPorts[p] = struct{}{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue