mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 21:31:02 +00:00
Merge pull request #1801 from olymk2/master
Add in docker shm-size option, mainly for oracle xe [ci skip]
This commit is contained in:
commit
3f052c7517
3 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,7 @@ func toContainerConfig(c *yaml.Container) *dockerclient.ContainerConfig {
|
||||||
Privileged: c.Privileged,
|
Privileged: c.Privileged,
|
||||||
NetworkMode: c.Network,
|
NetworkMode: c.Network,
|
||||||
Memory: c.MemLimit,
|
Memory: c.MemLimit,
|
||||||
|
ShmSize: c.ShmSize,
|
||||||
CpuShares: c.CPUShares,
|
CpuShares: c.CPUShares,
|
||||||
CpuQuota: c.CPUQuota,
|
CpuQuota: c.CPUQuota,
|
||||||
CpusetCpus: c.CPUSet,
|
CpusetCpus: c.CPUSet,
|
||||||
|
|
|
@ -40,6 +40,7 @@ type Container struct {
|
||||||
DNSSearch []string
|
DNSSearch []string
|
||||||
MemSwapLimit int64
|
MemSwapLimit int64
|
||||||
MemLimit int64
|
MemLimit int64
|
||||||
|
ShmSize int64
|
||||||
CPUQuota int64
|
CPUQuota int64
|
||||||
CPUShares int64
|
CPUShares int64
|
||||||
CPUSet string
|
CPUSet string
|
||||||
|
@ -75,6 +76,7 @@ type container struct {
|
||||||
DNSSearch types.StringOrSlice `yaml:"dns_search"`
|
DNSSearch types.StringOrSlice `yaml:"dns_search"`
|
||||||
MemSwapLimit int64 `yaml:"memswap_limit"`
|
MemSwapLimit int64 `yaml:"memswap_limit"`
|
||||||
MemLimit int64 `yaml:"mem_limit"`
|
MemLimit int64 `yaml:"mem_limit"`
|
||||||
|
ShmSize int64 `yaml:"shm_size"`
|
||||||
CPUQuota int64 `yaml:"cpu_quota"`
|
CPUQuota int64 `yaml:"cpu_quota"`
|
||||||
CPUShares int64 `yaml:"cpu_shares"`
|
CPUShares int64 `yaml:"cpu_shares"`
|
||||||
CPUSet string `yaml:"cpuset"`
|
CPUSet string `yaml:"cpuset"`
|
||||||
|
@ -144,6 +146,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
DNSSearch: cc.DNSSearch.Slice(),
|
DNSSearch: cc.DNSSearch.Slice(),
|
||||||
MemSwapLimit: cc.MemSwapLimit,
|
MemSwapLimit: cc.MemSwapLimit,
|
||||||
MemLimit: cc.MemLimit,
|
MemLimit: cc.MemLimit,
|
||||||
|
ShmSize: cc.ShmSize,
|
||||||
CPUQuota: cc.CPUQuota,
|
CPUQuota: cc.CPUQuota,
|
||||||
CPUShares: cc.CPUShares,
|
CPUShares: cc.CPUShares,
|
||||||
CPUSet: cc.CPUSet,
|
CPUSet: cc.CPUSet,
|
||||||
|
|
|
@ -51,6 +51,9 @@ func CheckTrusted(c *yaml.Container) error {
|
||||||
if c.Privileged {
|
if c.Privileged {
|
||||||
return fmt.Errorf("Insufficient privileges to use privileged mode")
|
return fmt.Errorf("Insufficient privileges to use privileged mode")
|
||||||
}
|
}
|
||||||
|
if c.ShmSize != 0 {
|
||||||
|
return fmt.Errorf("Insufficient privileges to override shm_size")
|
||||||
|
}
|
||||||
if len(c.DNS) != 0 {
|
if len(c.DNS) != 0 {
|
||||||
return fmt.Errorf("Insufficient privileges to use custom dns")
|
return fmt.Errorf("Insufficient privileges to use custom dns")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue