title: Dockerfile: how to Download a file using curl and copy into the container
body: <p>in this example, I copy wait-for-it.sh inside /app/wait-for-it.sh
  But, I don't want to save wait-for-it.sh in my local directory. I want to download it using curl and then copy into /app/wait-for-it.sh</p>
  
  <pre><code>FROM prismagraphql/prisma:1.34.8
  COPY ./wait-for-it.sh /app/wait-for-it.sh
  RUN chmod +x /app/wait-for-it.sh
  ENTRYPOINT ["/bin/sh","-c","/app/wait-for-it.sh mysql:3306 --timeout=0 -- /app/start.sh"]
  </code></pre>
  
  <p>What I have tried is this, but how can I get the <code>wait-for-it.sh</code> after downloading the file using curl command:</p>
  
  <pre><code>FROM prismagraphql/prisma:1.34.8
  
  FROM node:11-slim
  
  RUN apt-get update &amp;&amp; apt-get install -yq build-essential dumb-init
  
  RUN curl -LJO https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh
  
  COPY wait-for-it.sh /app/wait-for-it.sh
  
  RUN chmod +x /wait-for-it.sh
  
  ENTRYPOINT ["/bin/sh","-c","/wait-for-it.sh mysql:3306 --timeout=0 -- /app/start.sh"]
  </code></pre>