title: aws s3 cp inside a Dockerfile return permission denied
body: <p>I got surprised to see when <code>RUN aws s3 cp s3://&lt;bucket_name&gt;/application_artefacts/com-sdk/sdk_webserver-21.2.0-snapshot.tar.gz .</code> return error when it is executed from a Dockerfile. The Dockerfile is build inside a AWS instance.</p>
  <p><code>download failed: s3://&lt;bucket-name&gt;/application_artefacts/com-sdk/sdk_webserver-21.2.0-snapshot.tar.gz to ./pcc_webserver-21.2.0-snapshot.tar.gz [Errno 13] Permission denied: u'/app/sdk_webserver-21.2.0-snapshot.tar.gz.9520ab29'</code></p>
  <p>However, <code>aws s3 cp s3://&lt;bucket_name&gt;/application_artefacts/com-sdk/sdk_webserver-21.2.0-snapshot.tar.gz .</code> works properly inside AWS instance.</p>
  <p>Complete Dockerfile</p>
  <pre><code>FROM xxxx.dkr.ecr.ap-southeast-2.amazonaws.com/api-builder-jdk-corretto8:latest
  ARG profile
  WORKDIR /app
  RUN aws s3 cp s3://&lt;bucket-name&gt;/application_artefacts/com-sdk/sdk_webserver-21.2.0-snapshot.tar.gz .
  RUN aws s3 cp s3://&lt;bucket-name&gt;/application_artefacts/com-sdk/sdk_appserver-21.2.0-snapshot.tar.gz .
  RUN tar xvf /app/sdk_webserver-21.2.0-snapshot.tar.gz
  RUN tar xvf /app/sdk_appserver-21.2.0-snapshot.tar.gz
  ENTRYPOINT []
  </code></pre>