diff --git a/docker/data_source_docker_registry_image.go b/docker/data_source_docker_registry_image.go index 787a81bf..689f2a76 100644 --- a/docker/data_source_docker_registry_image.go +++ b/docker/data_source_docker_registry_image.go @@ -104,8 +104,12 @@ func getImageDigest(registry, image, tag, username, password string, fallback bo req.SetBasicAuth(username, password) } - // Set this header so that we get the v2 manifest back from the registry. - req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v2+json") + // We accept schema v2 manifests and manifest lists, and also OCI types + req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.v2+json") + req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.list.v2+json") + req.Header.Add("Accept", "application/vnd.oci.image.manifest.v1+json") + req.Header.Add("Accept", "application/vnd.oci.image.index.v1+json") + if fallback { // Fallback to this header if the registry does not support the v2 manifest like gcr.io req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v1+prettyjws") diff --git a/docker/resource_docker_container.go b/docker/resource_docker_container.go index 2b386987..b8e28672 100644 --- a/docker/resource_docker_container.go +++ b/docker/resource_docker_container.go @@ -250,6 +250,7 @@ func resourceDockerContainer() *schema.Resource { Type: schema.TypeSet, Description: "Specification for mounts to be added to containers created as part of the service", Optional: true, + ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "target": { diff --git a/docker/resource_docker_registry_image_funcs.go b/docker/resource_docker_registry_image_funcs.go index d7987ba1..20c98988 100644 --- a/docker/resource_docker_registry_image_funcs.go +++ b/docker/resource_docker_registry_image_funcs.go @@ -346,8 +346,12 @@ func deleteDockerRegistryImage(pushOpts internalPushImageOptions, sha256Digest, req.SetBasicAuth(username, password) } - // Set this header so that we get the v2 manifest back from the registry. - req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v2+json") + // We accept schema v2 manifests and manifest lists, and also OCI types + req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.v2+json") + req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.list.v2+json") + req.Header.Add("Accept", "application/vnd.oci.image.manifest.v1+json") + req.Header.Add("Accept", "application/vnd.oci.image.index.v1+json") + if fallback { // Fallback to this header if the registry does not support the v2 manifest like gcr.io req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v1+prettyjws")