Make container memory limit configurable
This commit is contained in:
@@ -288,7 +288,13 @@ func (d *docker) CreateContainer(opts CreateContainerOpts) error {
|
||||
}
|
||||
}
|
||||
h.Resources.PidsLimit = pidsLimit
|
||||
h.Resources.Memory = 4092 * Megabyte
|
||||
|
||||
if memLimit := os.Getenv("MAX_MEMORY_MB"); memLimit != "" {
|
||||
if i, err := strconv.Atoi(memLimit); err == nil {
|
||||
h.Resources.Memory = int64(i) * Megabyte
|
||||
}
|
||||
}
|
||||
|
||||
t := true
|
||||
h.Resources.OomKillDisable = &t
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ ARG VERSION=franela/docker:17.06.2-dind-ubuntu
|
||||
FROM ${VERSION}
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y git tmux apache2-utils vim curl zfs jq bash-completion \
|
||||
&& apt-get install -y git tmux apache2-utils vim curl jq bash-completion \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@ function wait_for_url {
|
||||
}
|
||||
|
||||
function deploy_ucp {
|
||||
wait_for_url "http://localhost:2375"
|
||||
wait_for_url "https://localhost:2376"
|
||||
docker run --rm --name ucp \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
docker/ucp:2.2.3 install --force-insecure-tcp \
|
||||
--san *.direct.${PWD_HOST_FQDN} \
|
||||
--license $(cat $HOME/workshop.lic) \
|
||||
--swarm-port 2375 \
|
||||
--admin-username admin \
|
||||
--admin-password admin1234
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user