title: Reduce build time in GitOps by using Docker image layers from previous build with Azure Registry
body: <p>I'm building a Docker Image on Pull Requests in my Github Actions setup. The images are built and pushed to Azure Container Registry. Often, it's only a small update in the code, and if I could reuse the layers from the previous build (pushed to ACR), I could save a lot of time.</p>
  <p>As shown in Dockerfile, <code>yarn install</code> could be skipped, since new changes occur in the <code>COPY</code> statement below it only:</p>
  <pre><code>FROM node:16
  
  # create dirs and chown
  RUN mkdir -p /usr/src/node-app &amp;&amp; chown -R node:node /usr/src/node-app
  
  WORKDIR /usr/src/node-app
  
  COPY package.json yarn.lock tsconfig.json ./
  
  USER node
  
  # install node modules
  RUN yarn install --pure-lockfile
  
  # ensure ownership
  COPY --chown=node:node . .
  
  # set default env
  RUN mv .env.example .env
  
  EXPOSE 3001
  
  # entrypoint is node
  # see https://github.com/nodejs/docker-node/blob/main/docker-entrypoint.sh
  
  # default command: prod start
  CMD [&quot;yarn&quot;, &quot;start&quot;]
  </code></pre>
  <p>How can I download the previous image from ACR and use the layers there? Simply downloading the previous image (with different tag) does not seem to work.</p>