title: How to copy a folder to another folder within docker container?
body: <p>I'm using nginx:alpine docker image.</p>
  
  <p>I try to do the compilation process in Dockerfile, and it generates a folder named dist in the docker container.</p>
  
  <p>At the last step, I try to copy the generated dist folder to /usr/share/nginx/html as instructed in <a href="https://hub.docker.com/_/nginx/" rel="nofollow noreferrer">https://hub.docker.com/_/nginx/</a></p>
  
  <p>What I have tried is:</p>
  
  <pre><code># Copy dist folder to destination
  RUN cp -rf dist /usr/share/nginx/html/
  </code></pre>
  
  <p>But the result is that when I run the image, the nginx displays the default nginx page.</p>
  
  <p>I have also tried to compile before I run docker build, and at the last step of Dockerfile:</p>
  
  <pre><code>COPY dist /user/share/nginx/html
  </code></pre>
  
  <p>And this time it works.</p>
  
  <p>Any idea how I can do the compilation in Dockerfile while I can successfully copy the generated dist folder to destination?</p>