title: using docker image from registry with terraform
body: <p>Im trying to use an docker image which is hosted on the docker hub registry with terraform. When i run <code>terraform apply</code> is says that it does not exist or docker login is required. And then it fails with an requested access to the resource is denied. What am i doing wrong?</p>
  <p>main.tf:</p>
  <pre><code>provider &quot;docker&quot; {
      host = &quot;npipe:////.//pipe//docker_engine&quot;
  
      registry_auth {
          address = &quot;registry.hub.docker.com&quot;
          username = &quot;username&quot;
          password = &quot;passwword&quot;
      }
  }
  
  resource &quot;docker_image&quot; &quot;ubuntu&quot; {
    name          = &quot;data.docker_registry_image.ubuntu.name&quot;
    pull_triggers = [&quot;data.docker_registry_image.ubuntu.sha256_digest&quot;]
  }
  
  data &quot;docker_registry_image&quot; &quot;ubuntu&quot; {
    name = &quot;ubuntu:latest&quot;
  }
  
  </code></pre>
  <p>versions.tf:</p>
  <pre><code>terraform {
    required_providers {
      docker = {
        source = &quot;terraform-providers/docker&quot;
      }
    }
    required_version = &quot;&gt;= 0.13&quot;
  }
  
  </code></pre>
  <p>error output:</p>
  <pre><code>Error: Unable to read Docker image into resource: Unable to pull image data.docker_registry_image.ubuntu.name: error pulling image data.docker_registry_image.ubuntu.name: Error response from daemon: pull access denied for data.docker_registry_image.ubuntu.name, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
  
    on main.tf line 11, in resource &quot;docker_image&quot; &quot;ubuntu&quot;:
    11: resource &quot;docker_image&quot; &quot;ubuntu&quot; {
  </code></pre>