|
@@ -7,6 +7,7 @@ import (
|
|
"fmt"
|
|
"fmt"
|
|
"io"
|
|
"io"
|
|
"net/http"
|
|
"net/http"
|
|
|
|
+ "strconv"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/Sirupsen/logrus"
|
|
@@ -357,11 +358,6 @@ func (s *router) postBuild(ctx context.Context, w http.ResponseWriter, r *http.R
|
|
buildConfig.ForceRemove = httputils.BoolValue(r, "forcerm")
|
|
buildConfig.ForceRemove = httputils.BoolValue(r, "forcerm")
|
|
buildConfig.MemorySwap = httputils.Int64ValueOrZero(r, "memswap")
|
|
buildConfig.MemorySwap = httputils.Int64ValueOrZero(r, "memswap")
|
|
buildConfig.Memory = httputils.Int64ValueOrZero(r, "memory")
|
|
buildConfig.Memory = httputils.Int64ValueOrZero(r, "memory")
|
|
- shmSize, err := httputils.Int64ValueOrDefault(r, "shmsize", runconfig.DefaultSHMSize)
|
|
|
|
- if err != nil {
|
|
|
|
- return errf(err)
|
|
|
|
- }
|
|
|
|
- buildConfig.ShmSize = &shmSize
|
|
|
|
buildConfig.CPUShares = httputils.Int64ValueOrZero(r, "cpushares")
|
|
buildConfig.CPUShares = httputils.Int64ValueOrZero(r, "cpushares")
|
|
buildConfig.CPUPeriod = httputils.Int64ValueOrZero(r, "cpuperiod")
|
|
buildConfig.CPUPeriod = httputils.Int64ValueOrZero(r, "cpuperiod")
|
|
buildConfig.CPUQuota = httputils.Int64ValueOrZero(r, "cpuquota")
|
|
buildConfig.CPUQuota = httputils.Int64ValueOrZero(r, "cpuquota")
|
|
@@ -369,6 +365,14 @@ func (s *router) postBuild(ctx context.Context, w http.ResponseWriter, r *http.R
|
|
buildConfig.CPUSetMems = r.FormValue("cpusetmems")
|
|
buildConfig.CPUSetMems = r.FormValue("cpusetmems")
|
|
buildConfig.CgroupParent = r.FormValue("cgroupparent")
|
|
buildConfig.CgroupParent = r.FormValue("cgroupparent")
|
|
|
|
|
|
|
|
+ if r.Form.Get("shmsize") != "" {
|
|
|
|
+ shmSize, err := strconv.ParseInt(r.Form.Get("shmsize"), 10, 64)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return errf(err)
|
|
|
|
+ }
|
|
|
|
+ buildConfig.ShmSize = &shmSize
|
|
|
|
+ }
|
|
|
|
+
|
|
if i := runconfig.IsolationLevel(r.FormValue("isolation")); i != "" {
|
|
if i := runconfig.IsolationLevel(r.FormValue("isolation")); i != "" {
|
|
if !runconfig.IsolationLevel.IsValid(i) {
|
|
if !runconfig.IsolationLevel.IsValid(i) {
|
|
return errf(fmt.Errorf("Unsupported isolation: %q", i))
|
|
return errf(fmt.Errorf("Unsupported isolation: %q", i))
|