Remove PortSpecs from Config

Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Antonio Murdaca
2015-05-29 22:38:09 +02:00
parent c42810fe99
commit 15134a3320
20 changed files with 44 additions and 171 deletions
+1 -10
View File
@@ -453,19 +453,11 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
b.Config.ExposedPorts = make(nat.PortSet)
}
ports, bindingMap, err := nat.ParsePortSpecs(append(portsTab, b.Config.PortSpecs...))
ports, _, err := nat.ParsePortSpecs(portsTab)
if err != nil {
return err
}
for _, bindings := range bindingMap {
if bindings[0].HostIp != "" || bindings[0].HostPort != "" {
fmt.Fprintf(b.ErrStream, " ---> Using Dockerfile's EXPOSE instruction"+
" to map host ports to container ports (ip:hostPort:containerPort) is deprecated.\n"+
" Please use -p to publish the ports.\n")
}
}
// instead of using ports directly, we build a list of ports and sort it so
// the order is consistent. This prevents cache burst where map ordering
// changes between builds
@@ -479,7 +471,6 @@ func expose(b *Builder, args []string, attributes map[string]bool, original stri
i++
}
sort.Strings(portList)
b.Config.PortSpecs = nil
return b.commit("", b.Config.Cmd, fmt.Sprintf("EXPOSE %s", strings.Join(portList, " ")))
}