From 4b7589bc673e3a392439211e9eea6f09dcc949a2 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Thu, 7 Sep 2017 15:52:03 -0300 Subject: [PATCH] Add Env variable to control container storage size --- docker/docker.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker/docker.go b/docker/docker.go index bb586e7..4da8cae 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -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 {