Merge pull request #14665 from coolljt0725/fix_build_with_resource_limit
Fix build with resource limit which system not support. Upstream-commit: 6f8c4480e4f99b08c84d25f1611d6b12ee646066 Component: engine
This commit is contained in:
@@ -11,15 +11,15 @@ import (
|
||||
"github.com/opencontainers/runc/libcontainer/label"
|
||||
)
|
||||
|
||||
func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig, adjustCPUShares bool) (string, []string, error) {
|
||||
func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hostConfig *runconfig.HostConfig, adjustCPUShares bool) (*Container, []string, error) {
|
||||
if config == nil {
|
||||
return "", nil, fmt.Errorf("Config cannot be empty in order to create a container")
|
||||
return nil, nil, fmt.Errorf("Config cannot be empty in order to create a container")
|
||||
}
|
||||
|
||||
warnings, err := daemon.verifyContainerSettings(hostConfig, config)
|
||||
daemon.adaptContainerSettings(hostConfig, adjustCPUShares)
|
||||
if err != nil {
|
||||
return "", warnings, err
|
||||
return nil, warnings, err
|
||||
}
|
||||
|
||||
container, buildWarnings, err := daemon.Create(config, hostConfig, name)
|
||||
@@ -29,14 +29,14 @@ func (daemon *Daemon) ContainerCreate(name string, config *runconfig.Config, hos
|
||||
if tag == "" {
|
||||
tag = tags.DefaultTag
|
||||
}
|
||||
return "", warnings, fmt.Errorf("No such image: %s (tag: %s)", config.Image, tag)
|
||||
return nil, warnings, fmt.Errorf("No such image: %s (tag: %s)", config.Image, tag)
|
||||
}
|
||||
return "", warnings, err
|
||||
return nil, warnings, err
|
||||
}
|
||||
|
||||
warnings = append(warnings, buildWarnings...)
|
||||
|
||||
return container.ID, warnings, nil
|
||||
return container, warnings, nil
|
||||
}
|
||||
|
||||
// Create creates a new container from the given configuration with a given name.
|
||||
|
||||
Reference in New Issue
Block a user