diff --git a/docker/label_migration.go b/docker/label_migration.go index fff03a14..5ab4f317 100644 --- a/docker/label_migration.go +++ b/docker/label_migration.go @@ -15,7 +15,14 @@ func replaceLabelsMapFieldWithSetField(rawState map[string]interface{}) map[stri func migrateContainerLabels(rawState map[string]interface{}) map[string]interface{} { replaceLabelsMapFieldWithSetField(rawState) - mounts := rawState["mounts"].([]interface{}) + m, ok := rawState["mounts"] + if !ok || m == nil { + // https://github.com/terraform-providers/terraform-provider-docker/issues/264 + rawState["mounts"] = []interface{}{} + return rawState + } + + mounts := m.([]interface{}) newMounts := make([]interface{}, len(mounts)) for i, mountI := range mounts { mount := mountI.(map[string]interface{}) diff --git a/docker/resource_docker_container.go b/docker/resource_docker_container.go index c752de2c..ee048195 100644 --- a/docker/resource_docker_container.go +++ b/docker/resource_docker_container.go @@ -459,7 +459,6 @@ func resourceDockerContainer() *schema.Resource { Type: schema.TypeSet, Optional: true, ForceNew: true, - Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, @@ -563,7 +562,6 @@ func resourceDockerContainer() *schema.Resource { Type: schema.TypeSet, Optional: true, ForceNew: true, - Computed: true, Elem: labelSchema, },