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
parent 5fdc102396
commit 877dbbbde8
9 changed files with 53 additions and 9 deletions
+2
View File
@@ -37,6 +37,7 @@ import (
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/pkg/tarsum"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/runconfig"
"github.com/docker/docker/utils"
)
@@ -129,6 +130,7 @@ type builder struct {
cgroupParent string
memory int64
memorySwap int64
ulimits []*ulimit.Ulimit
cancelled <-chan struct{} // When closed, job was cancelled.
+1
View File
@@ -615,6 +615,7 @@ func (b *builder) create() (*daemon.Container, error) {
CgroupParent: b.cgroupParent,
Memory: b.memory,
MemorySwap: b.memorySwap,
Ulimits: b.ulimits,
}
config := *b.Config
+3
View File
@@ -21,6 +21,7 @@ import (
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamformatter"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/docker/pkg/ulimit"
"github.com/docker/docker/pkg/urlutil"
"github.com/docker/docker/registry"
"github.com/docker/docker/runconfig"
@@ -62,6 +63,7 @@ type Config struct {
CPUSetCpus string
CPUSetMems string
CgroupParent string
Ulimits []*ulimit.Ulimit
AuthConfigs map[string]cliconfig.AuthConfig
Stdout io.Writer
@@ -205,6 +207,7 @@ func Build(d *daemon.Daemon, buildConfig *Config) error {
cgroupParent: buildConfig.CgroupParent,
memory: buildConfig.Memory,
memorySwap: buildConfig.MemorySwap,
ulimits: buildConfig.Ulimits,
cancelled: buildConfig.WaitCancelled(),
id: stringid.GenerateRandomID(),
}