title: Can we compute docker image digest before building the image to check against docker registry?
body: <p>So we have a git repository that has a number of docker images (multiple <code>Dockerfile</code>s each of which used for a different type of application build in our <code>Jenkins</code>)</p>
  
  <p>Now if one makes a change in one <code>Dockerfile</code> the Jenkins job will build and pushe all other <code>Dockerfile</code>s in the repository. I was wondering, if we were able to calcualte the digest id (SHA256) beforehand and compare that with our docker registry, if there is one already we can skip <code>docker build</code> and <code>docker push</code>.</p>
  
  <p>I couldn't find any command in <code>Docker</code> user guide but here with this post I also wanted to know if we can raise a ticket for this new feature if this approach works and if there is no way of calculating this <a href="https://docs.docker.com/engine/reference/commandline/pull/#pull-an-image-by-digest-immutable-identifier" rel="nofollow noreferrer">identifier</a></p>
  
  <p>Any other suggestion is greatly appreciated</p>