Add CPU limit, CPU Reservation and Memory Reservation

This adds support for CPU limit, CPU reservation as well as memory
reservation.

Specifically, when using the `deploy` key in Docker Compose.
This commit is contained in:
Charlie Drage
2017-08-03 09:41:14 -04:00
parent 3b2ef30afc
commit af26b797a2
9 changed files with 254 additions and 43 deletions
+3
View File
@@ -76,6 +76,8 @@ type ServiceConfig struct {
CPUSet string `compose:"cpuset" bundle:""`
CPUShares int64 `compose:"cpu_shares" bundle:""`
CPUQuota int64 `compose:"cpu_quota" bundle:""`
CPULimit int64 `compose:"" bundle:""`
CPUReservation int64 `compose:"" bundle:""`
CapAdd []string `compose:"cap_add" bundle:""`
CapDrop []string `compose:"cap_drop" bundle:""`
Expose []string `compose:"expose" bundle:""`
@@ -92,6 +94,7 @@ type ServiceConfig struct {
Stdin bool `compose:"stdin_open" bundle:""`
Tty bool `compose:"tty" bundle:""`
MemLimit yaml.MemStringorInt `compose:"mem_limit" bundle:""`
MemReservation yaml.MemStringorInt `compose:"" bundle:""`
TmpFs []string `compose:"tmpfs" bundle:""`
Dockerfile string `compose:"dockerfile" bundle:""`
Replicas int `compose:"replicas" bundle:""`