This command works as expected:
# docker run --rm -it public.ecr.aws/aws-cli/aws-cli:2.9.1 --version
aws-cli/2.9.1 Python/3.9.11 Linux/5.15.0-1026-aws docker/aarch64.amzn.2 prompt/off
But this does not:
# docker run --rm -it public.ecr.aws/aws-cli/aws-cli:2.9.1 s3 ls
Unable to locate credentials. You can configure credentials by running "aws configure".
Nor can I configure AWS credentials...
# docker run -it public.ecr.aws/aws-cli/aws-cli:2.9.1 aws configure
I am not sure how to use docker for aws command.
Update:
This seems to work as expected:
$ docker run --rm -it -v ~/.aws:/root/.aws public.ecr.aws/aws-cli/aws-cli:2.9.1 s3 ls
But in my case, I do not have credentials saved locally. Isn't the docker container recommended in such cases?