title: Jenkins Pipeline gcloud problems in docker
body: <p>I'm trying to set up jenkins pipeline according to
  <a href="https://tech.winton.com/2017/04/continuous-deployment-of-containerised-microservic/" rel="nofollow noreferrer">this</a> article but instead use google container registry to push the docker images to.</p>
  
  <p>The Problem: The part which fails me is this jenkinsfile stage block</p>
  
  <pre><code>stage ('Push Docker Image To Container Registry') {
    docker.image('google/cloud-sdk:alpine').inside {
        sh "echo ${env.GOOGLE_AUTH} &gt; gcp-key.json"
        sh 'gcloud auth activate-service-account --key-file ./service-account-creds.json'
    }
  }
  </code></pre>
  
  <p>The Error: </p>
  
  <pre><code>Please verify that you have permissions to write to the parent directory.)
  
  ERROR: (gcloud.components.update) Could not create directory [/.config/gcloud]: Permission denied.
  </code></pre>
  
  <p>I can't run any command to do with gcloud as the error above is what i get all the time. </p>
  
  <p>I tried create the "/.config" directory manually logged into the aws instance and open up the permission of the folder to everyone but that didn't help either.</p>
  
  <p>I also can't find anywhere how to properly setup google cloud for jenkins pipeline using docker.</p>
  
  <p>Any suggestions are greatly appreciated :)</p>