title: How to list images and tags from the gcr.io Docker Registry using the HTTP API?
body: <p>I'm trying to fetch a list of available images and their tags from Google Container Registry (gcr.io) in Node.js.</p>
  
  <p>I first use <code>google-auto-auth</code> to optain a token with scope <code>https://www.googleapis.com/auth/devstorage.read_write</code>,
  and I exchange that token for a <code>gcr.io</code> token like so:</p>
  
  <pre><code>axios.get('https://gcr.io/v2/token?service=gcr.io', {
    auth: {
      username: '_token',
      password: token // token I got from `google-auto-auth`
    }
  })
  </code></pre>
  
  <p>I then try to use this to call the <code>v2/_catalog</code> endpoint:</p>
  
  <pre><code>axios.get('https://gcr.io/v2/_catalog', {
    headers: {
      Authorization: `Bearer ${gcrToken}`
    }
  })
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <pre><code>{ 
    errors: [ { code: 'DENIED', message: 'Failed to retrieve projects.' } ] 
  }
  </code></pre>
  
  <p>Fair enough, it must require my project ID, but where am I supposed to provide it?</p>
  
  <p>Just to see if I could get anything else working, I tried:</p>
  
  <pre><code>axios.get('https://gcr.io/v2/my-project-id/my-image/tags/list', {
    headers: {
      Authorization: `Bearer ${gcrToken}`
    }
  })
  </code></pre>
  
  <p>And I get the following back:</p>
  
  <pre><code>{ 
    errors: [ 
      { 
        code: 'NAME_INVALID', 
        message: 'Requested repository does not match bearer token resource: my-project-id/my-image' 
      } 
    ] 
  }
  </code></pre>
  
  <p>How can I read image info from gcr.io?</p>