Add Env variable to control container storage size

This commit is contained in:
Marcos Lilljedahl
2017-09-07 15:52:03 -03:00
parent 150b089602
commit 4b7589bc67

View File

@@ -275,6 +275,11 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) error {
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))}
}
if os.Getenv("STORAGE_SIZE") != "" {
// assing 10GB size FS for each container
h.StorageOpt = map[string]string{"size": os.Getenv("STORAGE_SIZE")}
}
var pidsLimit = int64(1000)
if envLimit := os.Getenv("MAX_PROCESSES"); envLimit != "" {
if i, err := strconv.Atoi(envLimit); err == nil {