mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-02-03 20:29:30 -05:00
Added Docker links support to the docker_container resource.
This commit is contained in:
parent
518f7b6ffa
commit
2c7fb5fcc7
2 changed files with 12 additions and 0 deletions
|
|
@ -108,6 +108,14 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: stringSetHash,
|
||||
},
|
||||
|
||||
"links": &schema.Schema{
|
||||
Type: schema.TypeSet,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Elem: &schema.Schema{Type: schema.TypeString},
|
||||
Set: stringSetHash,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,10 @@ func resourceDockerContainerCreate(d *schema.ResourceData, meta interface{}) err
|
|||
hostConfig.DNS = stringSetToStringSlice(v.(*schema.Set))
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("links"); ok {
|
||||
hostConfig.Links = stringSetToStringSlice(v.(*schema.Set))
|
||||
}
|
||||
|
||||
if err := client.StartContainer(retContainer.ID, hostConfig); err != nil {
|
||||
return fmt.Errorf("Unable to start container: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue