mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 11:51: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,
|
||||
NetworkMode: c.Network,
|
||||
Memory: c.MemLimit,
|
||||
ShmSize: c.ShmSize,
|
||||
CpuShares: c.CPUShares,
|
||||
CpuQuota: c.CPUQuota,
|
||||
CpusetCpus: c.CPUSet,
|
||||
|
|
|
@ -40,6 +40,7 @@ type Container struct {
|
|||
DNSSearch []string
|
||||
MemSwapLimit int64
|
||||
MemLimit int64
|
||||
ShmSize int64
|
||||
CPUQuota int64
|
||||
CPUShares int64
|
||||
CPUSet string
|
||||
|
@ -75,6 +76,7 @@ type container struct {
|
|||
DNSSearch types.StringOrSlice `yaml:"dns_search"`
|
||||
MemSwapLimit int64 `yaml:"memswap_limit"`
|
||||
MemLimit int64 `yaml:"mem_limit"`
|
||||
ShmSize int64 `yaml:"shm_size"`
|
||||
CPUQuota int64 `yaml:"cpu_quota"`
|
||||
CPUShares int64 `yaml:"cpu_shares"`
|
||||
CPUSet string `yaml:"cpuset"`
|
||||
|
@ -144,6 +146,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
|||
DNSSearch: cc.DNSSearch.Slice(),
|
||||
MemSwapLimit: cc.MemSwapLimit,
|
||||
MemLimit: cc.MemLimit,
|
||||
ShmSize: cc.ShmSize,
|
||||
CPUQuota: cc.CPUQuota,
|
||||
CPUShares: cc.CPUShares,
|
||||
CPUSet: cc.CPUSet,
|
||||
|
|
|
@ -51,6 +51,9 @@ func CheckTrusted(c *yaml.Container) error {
|
|||
if c.Privileged {
|
||||
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 {
|
||||
return fmt.Errorf("Insufficient privileges to use custom dns")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue