<p>I'm trying via Jenkins to push an image to the container repository. It was working at first, but now, I got "access denied"</p>

<pre><code>docker -- push gcr.io/xxxxxxx-yyyyy-138623/myApp:master.1
The push refers to a repository [gcr.io/xxxxxxx-yyyyy-138623/myApp]
bdc3ba7fdb96: Preparing
5632c278a6dc: Waiting
denied: Access denied.
</code></pre>

<p>the Jenkinsfile look like :</p>

<pre><code>  sh("gcloud docker --authorize-only")
  sh("docker -- push gcr.io/xxxxxxx-yyyyy-138623/hotelpro4u:master.1")
</code></pre>

<p>Remarks:</p>

<ul>
<li>Jenkins is running in Google Cloud</li>
<li>If I try in Google Shell or from my computer, it's working</li>
<li>I followed this tutorial : <a href="https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes" rel="nofollow">https://github.com/GoogleCloudPlatform/continuous-deployment-on-kubernetes</a></li>
</ul>

<p>I'm stuck while 12 hours.... I need help</p>

<p>That error means that the GKE node is not authorized to push to the GCS bucket that is backing your repository.</p>

<p>This could be because:</p>

<ol>
<li>The cluster does not have the correct scopes to authenticate to GCS. Did you create the cluster w/ <code>--scopes storage-rw</code>?</li>
<li>The service account that the cluster is running as does not have permissions on the bucket. Check the <a href="https://console.cloud.google.com/iam-admin" rel="nofollow">IAM &amp; Admin section</a> on your project to make sure that the service account has the necessary role.</li>
</ol>
