1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-07-14 01:57:32 +08:00

Increase pidslimit to 1000 and allow to override via env var

This commit is contained in:
Marcos Lilljedahl 2017-02-01 17:29:14 -03:00
parent c0bafc5f3b
commit 434256f9cc
2 changed files with 10 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import (
"io"
"log"
"os"
"strconv"
"strings"
"github.com/docker/docker/api/types"
@ -188,7 +189,14 @@ func CreateInstance(session *Session, dindImage string) (*Instance, error) {
if os.Getenv("APPARMOR_PROFILE") != "" {
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))}
}
h.Resources.PidsLimit = int64(500)
var pidsLimit = int64(1000)
if envLimit := os.Getenv("MAX_PROCESSES"); envLimit != "" {
if i, err := strconv.Atoi(envLimit); err != nil {
pidsLimit = int64(i)
}
}
h.Resources.PidsLimit = pidsLimit
h.Resources.Memory = 4092 * Megabyte
t := true
h.Resources.OomKillDisable = &t

View File

@ -13,7 +13,7 @@
<h2>Before starting we need to verify you are a human</h2>
<form id="welcomeForm" method="POST" action="/">
<div class="g-recaptcha" data-callback="iAmHuman" data-sitekey="{{.}}"></div>
<input type="hidden" name="session-duration" value="1h"/>
<input type="hidden" name="session-duration" value="4h"/>
</form>
<img src="/assets/large_h.png" />
</div>