title: Build Docker image only if Code Repository has been updated (Jenkins)
body: <p>Currently, in a Jenkins job, I build a Docker image with files from a git repository. When this repository is changed/updated I would like to either:</p>
  
  <ol>
  <li>Be able to detect this in Jenkins so I can change my Bash script to rebuild the Docker image from my Dockerfile</li>
  <li>Find some other method of building my Docker image that does not require me to build it every time I run the Jenkins job (I run the job hourly, and it takes nearly 10 minutes to build the Docker image)</li>
  </ol>
  
  <p>What is a clean and efficient solution to this? Should I just build the image every time I run the job after all?</p>