What's causing authentication error when pushing Docker image to Google Container Registry?
<p>I am trying to push a Docker image to Google Container Registry from a CircleCI build, as per <a href="https://circleci.com/docs/continuous-deployment-with-google-container-engine/" rel="nofollow noreferrer">their instructions</a>. However, pushing to GCR fails due to an apparent authentication error:</p>

<pre><code>Using 'push eu.gcr.io/realtimemusic-147914/realtimemusic-test/realtimemusic-test' for DOCKER_ARGS.
The push refers to a repository [eu.gcr.io/realtimemusic-147914/realtimemusic-test/realtimemusic-test] (len: 1)

Post https://eu.gcr.io/v2/realtimemusic-147914/realtimemusic-test/realtimemusic-test/blobs/uploads/: token auth attempt for registry: https://eu.gcr.io/v2/token?account=oauth2accesstoken&amp;scope=repository%3Arealtimemusic-147914%2Frealtimemusic-test%2Frealtimemusic-test%3Apush%2Cpull&amp;service=eu.gcr.io request failed with status: 403 Forbidden
</code></pre>

<p>I've prior to pushing the Docker image authenticated the service account against Google Cloud:</p>

<pre><code>echo $GCLOUD_KEY | base64 --decode &gt; ${HOME}/client-secret.json
gcloud auth activate-service-account --key-file ${HOME}/client-secret.json
gcloud config set project $GCLOUD_PROJECT_ID
</code></pre>

<p>Then I build the image and push it to GCR:</p>

<pre><code>docker build -t $EXTERNAL_REGISTRY_ENDPOINT/realtimemusic-test -f docker/test/Dockerfile .
gcloud docker push -- $EXTERNAL_REGISTRY_ENDPOINT/realtimemusic-test
</code></pre>

<p>What am I doing wrong here?</p>