An image with aws cli installed, so you don't have to!
253
This image allows you to run aws cli commands either from the container itself, or as a simple command piped to the container. The advantage is that you do not need to install aws cli and each container connects to a different aws account, thereby avoiding multiple profiles.
Build time options:
At build time, the aws access key id and aws secret access can be passed in. Take care not to push an image to a registry with your details in! Timezone can be configured too. This is important as if the host and Docker image times are not close, the aws commands will be rejected.
Copy or download the github project. The commands below assume you have done this. Alternatively you could extend with FROM mononoke/aws-cli:latest
Simple build, with keys:
$ docker build -t --build-arg aws_access_key_id= --build-arg aws_secret_access_key= awscli .
Change the timezone
$ docker build -t --build-arg timezone="Asia/Tokyo" awscli .
You can run the image and set the keys, timezone etc at run time. This is the safer option.
Run in the background and set the access keys:
docker run -d -e AWS_ACCESS_KEY_ID=1234 -e AWS_SECRET_ACCESS_KEY=1234 --name aws-home-account awscli /script/./run.sh
$ docker exec -it sh
$ aws ec2 describe-instance
$ docker run -it awscli aws ec2 describe-instances
$ docker container stop
$ docker container start
Changing timezone is a build time parameter, based on the documentation: https://wiki.alpinelinux.org/wiki/Setting_the_timezone Default output for aws results is json Profiles are not supported to prevent the image being overloaded. If you want to do that, I would suggest giving the containers names.
Content type
Image
Digest
Size
36.2 MB
Last updated
over 8 years ago
docker pull mononoke/aws-cli