mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Add support for shm_size to docker driver. Required update of go-dockerclient
to more recent version (ba4298ecf4cfa216f1cce2befbf653359f62c722).
This commit is contained in:
@@ -80,6 +80,7 @@ type DockerDriverConfig struct {
|
||||
SSL bool `mapstructure:"ssl"` // Flag indicating repository is served via https
|
||||
TTY bool `mapstructure:"tty"` // Allocate a Pseudo-TTY
|
||||
Interactive bool `mapstructure:"interactive"` // Keep STDIN open even if not attached
|
||||
ShmSize int64 `mapstructure:"shm_size"` // Size of /dev/shm of the container in bytes
|
||||
}
|
||||
|
||||
func (c *DockerDriverConfig) Init() error {
|
||||
@@ -190,6 +191,9 @@ func (d *DockerDriver) Validate(config map[string]interface{}) error {
|
||||
"interactive": &fields.FieldSchema{
|
||||
Type: fields.TypeBool,
|
||||
},
|
||||
"shm_size": &fields.FieldSchema{
|
||||
Type: fields.TypeInt,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -349,6 +353,11 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task,
|
||||
}
|
||||
hostConfig.Privileged = hostPrivileged
|
||||
|
||||
// set SHM size
|
||||
if driverConfig.ShmSize != 0 {
|
||||
hostConfig.ShmSize = driverConfig.ShmSize
|
||||
}
|
||||
|
||||
// set DNS servers
|
||||
for _, ip := range driverConfig.DNSServers {
|
||||
if net.ParseIP(ip) != nil {
|
||||
|
||||
Reference in New Issue
Block a user