title: Does Jenkins cache dependencies and Docker layers when building?
body: <p>I'm developing a React app which will be put into a Docker image. I'd like to automate the step of building the image using Jenkins.</p>
  
  <p>This is my current <code>Jenkinsfile</code>...</p>
  
  <pre><code>pipeline {
  
      agent any
  
      stages {
          stage('Build') {
              steps {
                  script {
                      def commitHash = GIT_COMMIT.take(7)
                      echo 'Building Docker image for commit hash: ' + commitHash
                      def customImage = docker.build("myImage")
                  }
              }
          }
      }
  
  }
  </code></pre>
  
  <p>The image itself is created successfully. I'm now wondering:
  1. Will Jenkins download all the dependencies in my <code>package.json</code> with each build?
  2. Will Jenkins download all the layers with each build?</p>
  
  <p>Or will Jenkins notice that the dependencies and/or image layers already exist?</p>