aws-cli/1.15.5 Python/2.7.14 Linux/4.4.0-98-generic botocore/1.10.5
Installing the AWS Command Line Interface
docker pull rkhtech/awscli
$ docker run -i --rm rkhtech/awscli aws --version
aws-cli/1.15.5 Python/2.7.14 Linux/4.4.0-98-generic botocore/1.10.5
OR
$ alias aws='docker run -i rkhtech/awscli aws'
$ aws --version
aws-cli/1.15.5 Python/2.7.14 Linux/4.4.0-98-generic botocore/1.10.5
Note: If the container is installed on an EC2 instance, credentials are granted by way of a Role assigned to the Instance the container runs on. One gotcha is that you will still need to provide the default region to your commands (see below).
docker run -i --rm \
-e AWS_DEFAULT_REGION=us-west-2 \
-e AWS_ACCESS_KEY_ID=AKIAI67VIZ62T5I76Z6Q \
-e AWS_SECRET_ACCESS_KEY=DJl2b2B7HdcfU309WUF7zwc2ZRdHykqf2Jd3An2M \
rkhtech/awscli \
aws ec2 describe-instances
Note: These credentials have been removed and are no longer valid credentials.
docker run -i --rm -e AWS_DEFAULT_REGION=us-west-2 rkhtech/awscli aws ec2 describe-instances
docker run -i --rm rkhtech/awscli aws ec2 describe-instances --region=us-west-2