mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-01-16 03:32:55 -05:00
Add network_mode support to docker
This commit is contained in:
parent
3f3e9fab7d
commit
a44b873992
3 changed files with 11 additions and 0 deletions
|
|
@ -238,6 +238,12 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"network_mode": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,10 @@ func resourceDockerContainerCreate(d *schema.ResourceData, meta interface{}) err
|
|||
hostConfig.LogConfig.Config = mapTypeMapValsToString(v.(map[string]interface{}))
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("network_mode"); ok {
|
||||
hostConfig.NetworkMode = v
|
||||
}
|
||||
|
||||
createOpts.HostConfig = hostConfig
|
||||
|
||||
var retContainer *dc.Container
|
||||
|
|
|
|||
|
|
@ -155,5 +155,6 @@ resource "docker_container" "foo" {
|
|||
max-size = "10m"
|
||||
max-file = 20
|
||||
}
|
||||
network_mode = "bridge"
|
||||
}
|
||||
`
|
||||
|
|
|
|||
Loading…
Reference in a new issue