fix warning in build

This commit is contained in:
Victor Vieux 2013-10-30 14:36:38 -07:00 committed by Michael Crosby
parent 1edde0e8a3
commit ec488fa123

View file

@ -317,20 +317,29 @@ func (runtime *Runtime) Create(config *Config, name string) (*Container, []strin
return nil, nil, err
}
checkDeprecatedExpose := func(config *Config) bool {
if config != nil {
if config.PortSpecs != nil {
for _, p := range config.PortSpecs {
if strings.Contains(p, ":") {
return true
}
}
}
}
return false
}
warnings := []string{}
if checkDeprecatedExpose(img.Config) || checkDeprecatedExpose(config) {
warnings = append(warnings, "The mapping to public ports on your host has been deprecated. Use -p to publish the ports.")
}
if img.Config != nil {
if err := MergeConfig(config, img.Config); err != nil {
return nil, nil, err
}
}
warnings := []string{}
if config.PortSpecs != nil {
for _, p := range config.PortSpecs {
if strings.Contains(p, ":") {
warnings = append(warnings, "The mapping to public ports on your host has been deprecated. Use -p to publish the ports.")
break
}
}
}
if len(config.Entrypoint) != 0 && config.Cmd == nil {
config.Cmd = []string{}