From b3d6936d03b264b2586d14b7d0a153bdda60550d Mon Sep 17 00:00:00 2001 From: Sam Ban Date: Wed, 29 Sep 2021 09:01:17 +0100 Subject: [PATCH] memorylimit option --- docker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker.go b/docker.go index 819ff0b..5ce9f7a 100644 --- a/docker.go +++ b/docker.go @@ -158,6 +158,12 @@ func (d *Docker) Run(ctx context.Context, image, imageurl string, labels map[str hostconfig.NanoCPUs = nano } + if len(conf["memorylimit"]) > 0 { + mem, _ := strconv.ParseInt(conf["memorylimit"][0], 10, 64) + log.Printf("Memory Limit: %v", mem) + hostconfig.Memory = mem + } + links := []string{} for _, l := range conf["links"] { l2, err := filehelper.Template(l, running)