title: Dockerfile copy files from amazon s3 or another source that needs credentials
body: <p>I am trying to build a Docker image and I need to copy some files from S3 to the image. </p>
  
  <p>Inside the Dockerfile I am using:</p>
  
  <p>Dockerfile  </p>
  
  <pre><code>FROM library/ubuntu:16.04
  ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
  
  # Copy files from S3 inside docker
  RUN aws s3 COPY s3://filepath_on_s3 /tmp/
  </code></pre>
  
  <p>However, <code>aws</code> requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
  I know I can probably pass them using <code>ARG</code>. But, is it a bad idea to pass them to the image at build time?</p>
  
  <p>How can I achieve this without storing the secret keys in the image?</p>