From f793c1b50c339742ea384b3e059f85f649e68f26 Mon Sep 17 00:00:00 2001 From: Lei Date: Thu, 23 Jul 2015 10:26:06 +0800 Subject: [PATCH] Add ulimit to docker build. Signed-off-by: Lei Jitang --- contrib/completion/bash/docker | 2 +- docs/reference/commandline/build.md | 6 +++++- man/docker-build.1.md | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 1cc7a20c48..85959f4e77 100755 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -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')" diff --git a/docs/reference/commandline/build.md b/docs/reference/commandline/build.md index e6fefc1f20..037003d9be 100644 --- a/docs/reference/commandline/build.md +++ b/docs/reference/commandline/build.md @@ -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). diff --git a/man/docker-build.1.md b/man/docker-build.1.md index 2d9e694d43..a8714b775a 100644 --- a/man/docker-build.1.md +++ b/man/docker-build.1.md @@ -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