title: Jenkins declarative docker Pipeline with angular
body: <p>I am running a declarative docker pipeline in Jenkins that builds an angular project:</p>
  <pre><code>pipeline{
      agent {
          dockerfile {
              label 'linux'
              filename 'Dockerfile'
              args '-u root:root'
          }
      }
  </code></pre>
  <p>I install the angular npm dependencies with <code>npm ci</code>:</p>
  <pre><code>stage(&quot;build npm dependencies&quot;){
      steps{
          checkout scm
          sh '''npm ci'''
      }
  }
  </code></pre>
  <p>However, the build always fails with permission denied:</p>
  <pre><code>+ npm ci
  npm ERR! code 1
  npm ERR! path /opt/jenkins/project/project_ui-project_feat_build/node_modules/cypress
  npm ERR! command failed
  npm ERR! command sh -c node index.js --exec install
  npm ERR! Cypress cannot write to the cache directory due to file permissions
  npm ERR! Failed to access /root/.cache/Cypress:
  npm ERR! 
  npm ERR! EACCES: permission denied, mkdir
  </code></pre>
  <p>I tried to resolve this using the root user, but still it fails. What can I do to resolve this issue?</p>