title: Multi-stage docker build is failing because it can't see R from the first build
body: <p><strong>Problem</strong></p>
  
  <p>I'm trying to create a multi-image Dockerfile that first pulls the bioconductor image, invokes a setup R script, and then pulls an ubuntu image to install python-related packages. Even though I've saved R to path from the first-stage build, it appears this is not retained after the second-stage build, because when I invoke the entrypoint script <code>run_deseq2.py</code>, it says: <code>/bin/sh: 1: Rscript: not found</code>. How can I properly combine these two stages in the same dockerfile so that they can still "see" each other?</p>
  
  <p><strong>Dockerfile</strong></p>
  
  <pre><code>FROM bioconductor/release_base2
  
  ADD src/setup.R /
  RUN Rscript /setup.R
  
  ENV PATH=/usr/local/bin/:$PATH
  
  FROM ubuntu:19.04 
  
  ENV DEBIAN_FRONTEND=noninteractive  
  
  WORKDIR / 
  
  RUN apt-get update &amp;&amp; \ 
      apt-get install -y \ 
          python-dev \ 
          python-pip \ 
          wget 
  
  RUN pip install awscli boto3
  
  COPY src/run_deseq2.py /
  COPY src/s3_utils.py /
  COPY src/job_utils.py /
  COPY src/deseq2.R /
  COPY src/ModelLoxTag.R /
  
  ENV R_THREADS=30 
  
  # Run docker, starting with run script
  ENTRYPOINT ["python", "/run_deseq2.py"]
  </code></pre>