diff --git a/internal/provider/resource_docker_container.go b/internal/provider/resource_docker_container.go index 4682a35f7..a9f5a4600 100644 --- a/internal/provider/resource_docker_container.go +++ b/internal/provider/resource_docker_container.go @@ -957,6 +957,12 @@ func resourceDockerContainer() *schema.Resource { Optional: true, ForceNew: true, }, + "cgroup_parent": { + Type: schema.TypeString, + Description: "Optional parent cgroup for the container", + Optional: true, + ForceNew: true, + }, }, } } diff --git a/internal/provider/resource_docker_container_funcs.go b/internal/provider/resource_docker_container_funcs.go index f51ce0c80..3b3d4936b 100644 --- a/internal/provider/resource_docker_container_funcs.go +++ b/internal/provider/resource_docker_container_funcs.go @@ -371,6 +371,10 @@ func resourceDockerContainerCreate(ctx context.Context, d *schema.ResourceData, } } + if v, ok := d.GetOk("cgroupns_mode"); ok { + hostConfig.CgroupParent = v.(string) + } + init := d.Get("init").(bool) hostConfig.Init = &init