mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-15 02:37:27 +08:00
Increase pidslimit to 1000 and allow to override via env var
This commit is contained in:
parent
c0bafc5f3b
commit
434256f9cc
@ -5,6 +5,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
@ -188,7 +189,14 @@ func CreateInstance(session *Session, dindImage string) (*Instance, error) {
|
|||||||
if os.Getenv("APPARMOR_PROFILE") != "" {
|
if os.Getenv("APPARMOR_PROFILE") != "" {
|
||||||
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", 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
|
h.Resources.Memory = 4092 * Megabyte
|
||||||
t := true
|
t := true
|
||||||
h.Resources.OomKillDisable = &t
|
h.Resources.OomKillDisable = &t
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<h2>Before starting we need to verify you are a human</h2>
|
<h2>Before starting we need to verify you are a human</h2>
|
||||||
<form id="welcomeForm" method="POST" action="/">
|
<form id="welcomeForm" method="POST" action="/">
|
||||||
<div class="g-recaptcha" data-callback="iAmHuman" data-sitekey="{{.}}"></div>
|
<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>
|
</form>
|
||||||
<img src="/assets/large_h.png" />
|
<img src="/assets/large_h.png" />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user