Sign inSign up

creativearea/aws

By creativearea

Updated almost 11 years ago

Universal Command Line Interface for Amazon Web Services through Docker

Image
1

484

creativearea/aws repository overview

aws-cli through Docker

Universal Command Line Interface for Amazon Web Services through Docker.

Usage

docker run --rm -i \
-e AWS_ACCESS_KEY_ID=[your-aws-access-key-id] \
-e AWS_SECRET_ACCESS_KEY=[your-ws-secret-access-key] \
creativearea/aws [options] <command> <subcommand> [parameters]

You can also use a config file to tell AWS cli about your credentials:

docker run --rm -i \
-v $(pwd)/config:/root/.aws
creativearea/aws [options] <command> <subcommand> [parameters]

Please refer to Getting Started and the Configurable Variables sections of the AWS Cli documentation.

Use case

Let's say for example you want to periodically backup your MySQL database (running in another Docker container) to an S3 bucket. You could setup a daily cronjob on your host that run the following command:

docker run --rm -i \
--link mysql:mysql \
mysql \
sh -c 'exec mysqldump -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" my-app-database' \
| \
docker run --rm -i \
-e AWS_ACCESS_KEY_ID=xxxxxxxxxxxx \
-e AWS_SECRET_ACCESS_KEY=xxxxxxxxxx \
creativearea/aws s3 cp - s3://tweenpics-mysql-backups/mysql_backup_$(date "+%y%m%d").sql

Tag summary

Content type

Image

Digest

sha256:2fb0369ef

Size

261.3 MB

Last updated

almost 11 years ago

docker pull creativearea/aws