Sign inSign up

jdrago999/aws-cli

By jdrago999

•Updated about 9 years ago

Run the AWS CLI tools from CoreOS on Docker, the easy way

Image
0

100K+

jdrago999/aws-cli repository overview

⁠AWS CLI on CoreOS

No, you can't install aws-cli on CoreOS.

Yes, you can run this container and call out to it.

⁠Problem

I wanted to pull container images from my Elastic Container Registry (ECR) into my CoreOS on EC2, but in an automated way.

  • Sure I could do it manually just fine.
  • I wanted to do it automatically.
  • AWS documentation offered no obvious solution beyond "use ECS" which has its own share of problems.

⁠Solution

Run a container within CoreOS that has the aws cli tools installed, and simply mount a volume from CoreOS that contains the necessary configuration. Run commands from within that.

⁠Instructions

⁠Run
docker build -t jdrago999/aws-cli .
⁠Configuration files

Make sure ~/.aws/config and ~/.aws/credentials exist in your CoreOS instance.

⁠~/.aws/config
[default]
region = us-east-1
⁠~/.aws/credentials
[default]
aws_access_key_id = AKIXXXXXXXXXXXXXXXXX
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
⁠Run your commands within the container
docker run -it -v $HOME/.aws:/home/aws/.aws jdrago999/aws-cli <command> <args>
⁠Examples

List Buckets

docker run -it -v $HOME/.aws:/home/aws/.aws jdrago999/aws-cli aws s3 ls

Get ECR Login

docker run -it -v $HOME/.aws:/home/aws/.aws jdrago999/aws-cli aws ecr get-login

Use a named profile

run -it -v $HOME/.aws:/home/aws/.aws jdrago999/aws-cli aws ecr get-login --profile groove

⁠See Also

Tag summary

Content type

Image

Digest

Size

30.9 MB

Last updated

about 9 years ago

docker pull jdrago999/aws-cli