瀏覽代碼

set CPU quota

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 2 年之前
父節點
當前提交
d0e95ccac3
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      pkg/compose/create.go

+ 2 - 1
pkg/compose/create.go

@@ -529,7 +529,8 @@ func getDeployResources(s types.ServiceConfig) container.Resources {
 		CPURealtimePeriod:  s.CPURTPeriod,
 		CPURealtimeRuntime: s.CPURTRuntime,
 		CPUShares:          s.CPUShares,
-		CPUPercent:         int64(s.CPUS * 100),
+		NanoCPUs:           int64(s.CPUS * 1e9),
+		CPUPercent:         int64(s.CPUPercent * 100),
 		CpusetCpus:         s.CPUSet,
 		DeviceCgroupRules:  s.DeviceCgroupRules,
 	}