mirror of
https://github.com/docker/docs.git
synced 2026-03-31 08:18:55 +07:00
Merge pull request #11844 from jbarbier/cgroup-parent-42
Adding cgroup-parent option for docker build
This commit is contained in:
@@ -58,6 +58,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||
flCpuQuota := cmd.Int64([]string{"-cpu-quota"}, 0, "Limit the CPU CFS (Completely Fair Scheduler) quota")
|
||||
flCPUSetCpus := cmd.String([]string{"-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")
|
||||
flCPUSetMems := cmd.String([]string{"-cpuset-mems"}, "", "MEMs in which to allow execution (0-3, 0,1)")
|
||||
flCgroupParent := cmd.String([]string{"-cgroup-parent"}, "", "Optional parent cgroup for the container")
|
||||
|
||||
cmd.Require(flag.Exact, 1)
|
||||
cmd.ParseFlags(args, true)
|
||||
@@ -276,6 +277,7 @@ func (cli *DockerCli) CmdBuild(args ...string) error {
|
||||
v.Set("cpuquota", strconv.FormatInt(*flCpuQuota, 10))
|
||||
v.Set("memory", strconv.FormatInt(memory, 10))
|
||||
v.Set("memswap", strconv.FormatInt(memorySwap, 10))
|
||||
v.Set("cgroupparent", *flCgroupParent)
|
||||
|
||||
v.Set("dockerfile", *dockerfileName)
|
||||
|
||||
|
||||
@@ -1301,6 +1301,7 @@ func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *ht
|
||||
buildConfig.CpuQuota = int64ValueOrZero(r, "cpuquota")
|
||||
buildConfig.CpuSetCpus = r.FormValue("cpusetcpus")
|
||||
buildConfig.CpuSetMems = r.FormValue("cpusetmems")
|
||||
buildConfig.CgroupParent = r.FormValue("cgroupparent")
|
||||
|
||||
// Job cancellation. Note: not all job types support this.
|
||||
if closeNotifier, ok := w.(http.CloseNotifier); ok {
|
||||
|
||||
Reference in New Issue
Block a user