mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-15 10:47:26 +08:00
Apply apparmor profile if env variable is present
This commit is contained in:
parent
dea778440e
commit
b48812b085
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
@ -181,6 +182,10 @@ func ResizeConnection(name string, cols, rows uint) error {
|
||||
|
||||
func CreateInstance(session *Session, dindImage string) (*Instance, error) {
|
||||
h := &container.HostConfig{NetworkMode: container.NetworkMode(session.Id), Privileged: true}
|
||||
|
||||
if os.Getenv("APPARMOR_PROFILE") != "" {
|
||||
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))}
|
||||
}
|
||||
h.Resources.PidsLimit = int64(500)
|
||||
h.Resources.Memory = 4092 * Megabyte
|
||||
t := true
|
||||
|
Loading…
x
Reference in New Issue
Block a user