Building upon the suggestion by Tom in jarmod's answer, to "configure your keys in a config file that you then share with your docker container instead".
I found that slightly confusing as I'm new to using Docker and awscli.
Also, I believe most who end up at this question are similarly trying to use Docker and awscli
together.
So what you'd want to do, step by step is:
Create a credentials
file containing
[default]
aws_access_key_id = default_access_key
aws_secret_access_key = default_secret_key
that you copy to ~/.aws/credentials
, using a line in Dockerfile like
COPY credentials /root/.aws/credentials
and a config
file containing
[default]
region = us-west-2
output = table
that you copy to ~/.aws/config
, using a line in Dockerfile like
COPY config /root/.aws/config
Reference:
aws configure set help