Skip to content

Commit 9d12eec

Browse files
authored
Merge pull request docker#10100 from ndeloof/cpus
set CPU quota
2 parents 1e682a4 + d0e95cc commit 9d12eec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/compose/create.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
529529
CPURealtimePeriod: s.CPURTPeriod,
530530
CPURealtimeRuntime: s.CPURTRuntime,
531531
CPUShares: s.CPUShares,
532-
CPUPercent: int64(s.CPUS * 100),
532+
NanoCPUs: int64(s.CPUS * 1e9),
533+
CPUPercent: int64(s.CPUPercent * 100),
533534
CpusetCpus: s.CPUSet,
534535
DeviceCgroupRules: s.DeviceCgroupRules,
535536
}

0 commit comments

Comments
 (0)