mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2025-12-25 00:59:49 -05:00
parent
42031f27fb
commit
36567a2a9b
4 changed files with 15 additions and 0 deletions
|
|
@ -722,6 +722,12 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
"ipc_mode": {
|
||||
Type: schema.TypeString,
|
||||
Description: "IPC sharing mode for the container",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,6 +308,9 @@ func resourceDockerContainerCreate(d *schema.ResourceData, meta interface{}) err
|
|||
if v, ok := d.GetOk("sysctls"); ok {
|
||||
hostConfig.Sysctls = mapTypeMapValsToString(v.(map[string]interface{}))
|
||||
}
|
||||
if v, ok := d.GetOk("ipc_mode"); ok {
|
||||
hostConfig.IpcMode = container.IpcMode(v.(string))
|
||||
}
|
||||
|
||||
var retContainer container.ContainerCreateCreatedBody
|
||||
|
||||
|
|
|
|||
|
|
@ -455,6 +455,10 @@ func TestAccDockerContainer_customized(t *testing.T) {
|
|||
return fmt.Errorf("Container doesn't have a correct working dir")
|
||||
}
|
||||
|
||||
if c.HostConfig.IpcMode != "private" {
|
||||
return fmt.Errorf("Container doesn't have a correct ipc mode")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -1435,6 +1439,7 @@ resource "docker_container" "foo" {
|
|||
|
||||
pid_mode = "host"
|
||||
userns_mode = "testuser:231072:65536"
|
||||
ipc_mode = "private"
|
||||
working_dir = "/tmp"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,6 +107,7 @@ data is stored in them. See [the docker documentation][linkdoc] for more details
|
|||
* `userns_mode` - (Optional, string) Sets the usernamespace mode for the container when usernamespace remapping option is enabled.
|
||||
* `healthcheck` - (Optional, block) See [Healthcheck](#healthcheck-1) below for details.
|
||||
* `sysctls` - (Optional, map) A map of kernel parameters (sysctls) to set in the container.
|
||||
* `ipc_mode` - (Optional, string) IPC sharing mode for the container. Possible values are: `none`, `private`, `shareable`, `container:<name|id>` or `host`.
|
||||
|
||||
<a id="capabilities-1"></a>
|
||||
### Capabilities
|
||||
|
|
|
|||
Loading…
Reference in a new issue