Add hostname parameter to Docker driver
This commit is contained in:
parent
03ec9e980c
commit
77923255b4
|
@ -43,6 +43,7 @@ type DockerDriverConfig struct {
|
|||
Privileged bool `mapstructure:"privileged"` // Flag to run the container in priviledged mode
|
||||
DNS string `mapstructure:"dns_server"` // DNS Server for containers
|
||||
SearchDomains string `mapstructure:"search_domains"` // DNS Search domains for containers
|
||||
Hostname string `mapstructure:"hostname"` // Hostname for containers
|
||||
}
|
||||
|
||||
func (c *DockerDriverConfig) Validate() error {
|
||||
|
@ -167,7 +168,8 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task, dri
|
|||
env.SetTaskLocalDir(filepath.Join("/", allocdir.TaskLocal))
|
||||
|
||||
config := &docker.Config{
|
||||
Image: driverConfig.ImageName,
|
||||
Image: driverConfig.ImageName,
|
||||
Hostname: driverConfig.Hostname,
|
||||
}
|
||||
|
||||
hostConfig := &docker.HostConfig{
|
||||
|
|
|
@ -42,6 +42,8 @@ The `docker` driver supports the following configuration in the job specificatio
|
|||
|
||||
* `search-domains` - (optional) A comma separated list of DNS search domains for the
|
||||
container to use.
|
||||
|
||||
* `hostname` - (optional) The hostname to assign to the container.
|
||||
|
||||
**Authentication**
|
||||
Registry authentication can be set per task with the following authentication
|
||||
|
|
Loading…
Reference in a new issue