mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
Add cpu cfs quota to build
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
@@ -124,6 +124,7 @@ type Builder struct {
|
||||
cpuSetCpus string
|
||||
cpuSetMems string
|
||||
cpuShares int64
|
||||
cpuQuota int64
|
||||
memory int64
|
||||
memorySwap int64
|
||||
|
||||
|
||||
@@ -547,6 +547,7 @@ func (b *Builder) create() (*daemon.Container, error) {
|
||||
|
||||
hostConfig := &runconfig.HostConfig{
|
||||
CpuShares: b.cpuShares,
|
||||
CpuQuota: b.cpuQuota,
|
||||
CpusetCpus: b.cpuSetCpus,
|
||||
CpusetMems: b.cpuSetMems,
|
||||
Memory: b.memory,
|
||||
|
||||
@@ -49,6 +49,7 @@ type Config struct {
|
||||
Memory int64
|
||||
MemorySwap int64
|
||||
CpuShares int64
|
||||
CpuQuota int64
|
||||
CpuSetCpus string
|
||||
CpuSetMems string
|
||||
AuthConfig *cliconfig.AuthConfig
|
||||
@@ -169,6 +170,7 @@ func Build(d *daemon.Daemon, buildConfig *Config) error {
|
||||
ConfigFile: buildConfig.ConfigFile,
|
||||
dockerfileName: buildConfig.DockerfileName,
|
||||
cpuShares: buildConfig.CpuShares,
|
||||
cpuQuota: buildConfig.CpuQuota,
|
||||
cpuSetCpus: buildConfig.CpuSetCpus,
|
||||
cpuSetMems: buildConfig.CpuSetMems,
|
||||
memory: buildConfig.Memory,
|
||||
|
||||
Reference in New Issue
Block a user