Signed-off-by: Darren Stahl <darst@microsoft.com>
@@ -92,6 +92,11 @@ func (daemon *Daemon) createSpec(c *container.Container) (*specs.Spec, error) {
}
} else {
cpuPercent = uint8(c.HostConfig.NanoCPUs * 100 / int64(sysinfo.NumCPU()) / 1e9)
+
+ if cpuPercent < 1 {
+ // The requested NanoCPUs is so small that we rounded to 0, use 1 instead
+ cpuPercent = 1
+ }
memoryLimit := uint64(c.HostConfig.Memory)