title: Organizing overlay2 docker layers manually after parallel buildkit build
body: <p>I am using docker with buildkit and multi-stage builds to create a number of conda environments in parallel then copying them into my final stage. Many of the layers have large complex dependencies and copying each of the environments into the final stage taking a really long time.</p>
  <p>An example:</p>
  <pre><code>FROM custom.docker.repo:4567/custom/conda/env:latest as conda
  
  FROM conda as foo
  COPY lib/foo/environment.yml /tmp/foo.yml
  RUN conda env update -f /tmp/foo.yml &amp;&amp; conda clean -afy
  
  FROM conda as bar
  COPY lib/bar/environment.yml /tmp/bar.yml
  RUN conda env update -f /tmp/bar.yml &amp;&amp; conda clean -afy
  
  FROM conda as baz
  COPY lib/baz/environment.yml /tmp/baz.yml
  RUN conda env update -f /tmp/baz.yml &amp;&amp; conda clean -afy
  
  FROM conda as final
  COPY --from=foo /opt/conda/envs/foo /opt/conda/envs/foo
  COPY --from=bar /opt/conda/envs/bar /opt/conda/envs/bar
  COPY --from=baz /opt/conda/envs/baz /opt/conda/envs/baz
  
  ....
  </code></pre>
  <p>I know that the intermediate layers do not have overlapping files and would like to &quot;cherry pick&quot; them directly onto the final stage's history without having to use <code>COPY --from=...</code> commands. Is this type of low-level overlay2 manipulation possible with docker or the buildkit tooling?</p>