Add ulimit to docker build.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Lei 2015-07-23 10:26:06 +08:00 committed by Tibor Vass
parent 7fd94dfdba
commit f793c1b50c
3 changed files with 13 additions and 2 deletions

View File

@ -395,7 +395,7 @@ _docker_build() {
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--cgroup-parent --cpuset-cpus --cpuset-mems --cpu-shares -c --cpu-period --cpu-quota --file -f --force-rm --help --memory -m --memory-swap --no-cache --pull --quiet -q --rm --tag -t" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--cgroup-parent --cpuset-cpus --cpuset-mems --cpu-shares -c --cpu-period --cpu-quota --file -f --force-rm --help --memory -m --memory-swap --no-cache --pull --quiet -q --rm --tag -t --ulimit" -- "$cur" ) )
;;
*)
local counter="$(__docker_pos_first_nonflag '--cgroup-parent|--cpuset-cpus|--cpuset-mems|--cpu-shares|-c|--cpu-period|--cpu-quota|--file|-f|--memory|-m|--memory-swap|--tag|-t')"

View File

@ -28,6 +28,7 @@ weight=1
--cpuset-mems="" MEMs in which to allow execution, e.g. `0-3`, `0,1`
--cpuset-cpus="" CPUs in which to allow execution, e.g. `0-3`, `0,1`
--cgroup-parent="" Optional parent cgroup for the container
--ulimit=[] Ulimit options
Builds Docker images from a Dockerfile and a "context". A build's context is
the files located in the specified `PATH` or `URL`. The build process can refer
@ -245,5 +246,8 @@ the command line.
When `docker build` is run with the `--cgroup-parent` option the containers
used in the build will be run with the [corresponding `docker run`
flag](/reference/run/#specifying-custom-cgroups).
flag](/reference/run/#specifying-custom-cgroups).
Using the `--ulimit` option with `docker build` will cause each build step's
container to be started using those [`--ulimit`
flag values](/reference/run/#setting-ulimits-in-a-container).

View File

@ -22,6 +22,7 @@ docker-build - Build a new image from the source code at PATH
[**--cpuset-cpus**[=*CPUSET-CPUS*]]
[**--cpuset-mems**[=*CPUSET-MEMS*]]
[**--cgroup-parent**[=*CGROUP-PARENT*]]
[**--ulimit**[=*[]*]]
PATH | URL | -
@ -142,6 +143,12 @@ two memory nodes.
If the path is not absolute, the path is considered relative to the `cgroups` path of the init process.
Cgroups are created if they do not already exist.
**--ulimit**=[]
Ulimit options
For more information about `ulimit` see [Setting ulimits in a
container](https://docs.docker.com/reference/commandline/run/#setting-ulimits-in-a-container)
# EXAMPLES
## Building an image using a Dockerfile located inside the current directory