mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix warning in build
This commit is contained in:
parent
23b3747945
commit
ee81405567
1 changed files with 18 additions and 9 deletions
25
runtime.go
25
runtime.go
|
@ -317,20 +317,29 @@ func (runtime *Runtime) Create(config *Config, name string) (*Container, []strin
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if img.Config != nil {
|
checkDeprecatedExpose := func(config *Config) bool {
|
||||||
if err := MergeConfig(config, img.Config); err != nil {
|
if config != nil {
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
warnings := []string{}
|
|
||||||
if config.PortSpecs != nil {
|
if config.PortSpecs != nil {
|
||||||
for _, p := range config.PortSpecs {
|
for _, p := range config.PortSpecs {
|
||||||
if strings.Contains(p, ":") {
|
if strings.Contains(p, ":") {
|
||||||
warnings = append(warnings, "The mapping to public ports on your host has been deprecated. Use -p to publish the ports.")
|
return true
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(config.Entrypoint) != 0 && config.Cmd == nil {
|
if len(config.Entrypoint) != 0 && config.Cmd == nil {
|
||||||
config.Cmd = []string{}
|
config.Cmd = []string{}
|
||||||
|
|
Loading…
Reference in a new issue