title: openshift-origin add secret for gcr.io
body: <p>I've trying all day to add a secret for access to a private registry on gcr.io. ( Google Cloud Registry)</p>
  
  <p>The documentation from gcr has some info about a json key file.</p>
  
  <pre><code>$ docker login -e 1234@5678.com -u _json_key -p "$(cat keyfile.json)" https://eu.gcr.io
  </code></pre>
  
  <p>This creates an entry in the ~/.docker/config.json. If I locally then try to pull from the registry it works.</p>
  
  <p>I've tried the following in openshift to add the secret</p>
  
  <pre><code>oc secrets new gcr .dockerconfigjson="~/.docker/config.json"
  oc secrets add serviceaccount/default secrets/gcr --for=pull
  oc secrets add serviceaccount/builder secrets/gcr
  </code></pre>
  
  <p>And</p>
  
  <pre><code>oc secrets new-dockercfg gcr --docker-server=eu.gcr.io --docker-username=_json_key --docker-password="$(cat ~/Downloads/key.json)" --docker-email=web@gcr.com
  oc secrets add serviceaccount/default secrets/gcr --for=pull
  oc secrets add serviceaccount/builder secrets/gcr
  </code></pre>
  
  <p>This always results in the following</p>
  
  <pre><code>$ oc new-app eu.gcr.io/webshops/shop-1
  error: can't look up Docker image "eu.gcr.io/webshops/shop-1": Internal error occurred: error retrieving repository: server returned 403
  error: no match for "eu.gcr.io/webshops/shop-1"
  </code></pre>
  
  <p>Am I doing something wrong to access the eu.gcr.io from openshift?</p>