title: Can we include git commands in docker image?
body: <p>I am new to docker. I would like to create an image which will run as part of my project build to check commited files.</p>
  
  <p>My requirement is, Docker file should have these statements</p>
  
  <ol>
  <li>Get commited files from current git repo</li>
  <li>COPY myapp/ /app</li>
  <li>CMD /app/entry.pl <code>&lt;git files&gt;</code> (as command line arg)</li>
  </ol>
  
  <p>I would like to create an image for this process.</p>
  
  <p>I should get the git commited files list from current local repo and pass those files to my application to scan those files.</p>
  
  <p>While building my image I just need to copy my application but while running the container I need to run <code>git diff</code> to find changed files and pass that to my application as arguments.</p>
  
  <p>Is it possible to run <code>git diff</code> by docker container?</p>
  
  <p>UPDATE:</p>
  
  <p>I tried to execute <code>git diff</code> on current repo from docker but it is saying not a git repository.
  I am running my docker images as part of continuous integration in gitlab yml file. </p>
  
  <p>Please help me to achieve this requirement?</p>