mirror of https://github.com/docker/docs.git
fix cpus
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
6c9bf75dcd
commit
15a8b73ab6
|
@ -262,7 +262,9 @@ func (e *Engine) updateContainer(c dockerclient.Container, containers map[string
|
|||
// Convert the ContainerConfig from inspect into our own
|
||||
// cluster.ContainerConfig.
|
||||
container.Config = BuildContainerConfig(*info.Config)
|
||||
// FIXME remove "duplicate" lines and move this to cluster/config.go
|
||||
container.Config.CpuShares = container.Config.CpuShares * 1024.0 / e.Cpus
|
||||
container.Config.HostConfig.CpuShares = container.Config.HostConfig.CpuShares * 1024.0 / e.Cpus
|
||||
|
||||
// Save the entire inspect back into the container.
|
||||
container.Info = *info
|
||||
|
@ -376,7 +378,9 @@ func (e *Engine) Create(config *ContainerConfig, name string, pullImage bool) (*
|
|||
dockerConfig := config.ContainerConfig
|
||||
|
||||
// nb of CPUs -> real CpuShares
|
||||
// FIXME remove "duplicate" lines and move this to cluster/config.go
|
||||
dockerConfig.CpuShares = config.CpuShares * 1024 / e.Cpus
|
||||
dockerConfig.HostConfig.CpuShares = config.HostConfig.CpuShares * 1024 / e.Cpus
|
||||
|
||||
if id, err = client.CreateContainer(&dockerConfig, name); err != nil {
|
||||
// If the error is other than not found, abort immediately.
|
||||
|
|
Loading…
Reference in New Issue