Skip to content

A small Dockerfile and docker-compose.yml with awscli and awsebcli. My main use is on the Raspberry Pi.

License

Notifications You must be signed in to change notification settings

danielsanfr/aws-cli-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS CLI Docker

GitHub GitHub tag (latest SemVer)

A small Dockerfile and docker-compose.yml with awscli and awsebcli. My main use is on the Raspberry Pi.

To correctly install both awscli and awsebcli, a virtual environment was created for each CLI in their respective folders, /home/awscli/venvs/aws and /home/awscli/venvs/eb. Zsh (and oh-my-zsh) was also installed to facilitate the use of the shell.

Installation

You need install Docker and if you want a more simple way to use, I recommend docker-compose too.

A good start point to install this tools, is the official documentation on https://docs.docker.com/get-docker/ and https://docs.docker.com/compose/install/

After install Docker you can build the image in your system using:

$ sudo docker build -t awscli:0.1 .

Configuration

SSH keys

To use some of the features of awscli and awsebcli I recommend that you create a volume that points your local SSH keys to the /home/awscli/.ssh folder of the container. This is considered in the docker-compose as well as in the command to execute using only the docker.

Elastic Beanstalk configuration

If you want to keep the configuration of an Elastic Beanstalk application, I recommend that you also create a volume for a local folder where the application settings will be saved.

Environment Variables

Name Default Description
AWS_DEFAULT_REGION us-east-1 Specifies the AWS Region to send the request to.
AWS_ACCESS_KEY_ID Nothing Specifies an AWS access key associated with an IAM user or role.
AWS_SECRET_ACCESS_KEY Nothing Specifies the secret key associated with the access key. This is essentially the "password" for the access key.

Usage

If you are using docker:

$ sudo docker run \
    -e AWS_DEFAULT_REGION=us-east-1
    -e AWS_ACCESS_KEY_ID=<YOUR_ACCESS_KEY> \
    -e AWS_SECRET_ACCESS_KEY=<YOUR_SECRET_KEY> \
    -v /path/to/directory:/home/awscli/.ssh \
    -v /path/to/directory:/home/awscli/eb-apps/my-app \
    awscli:0.1 \
    zsh

If you are using docker-compose, put your environment variables in a .env file and execute:

$ sudo docker-compose run awscli zsh

Author

Daniel San Ferreira da Rocha daniel.samrocha@gmail.com

License

This is free and unencumbered software released into the public domain.

About

A small Dockerfile and docker-compose.yml with awscli and awsebcli. My main use is on the Raspberry Pi.

Topics

Resources

License

Stars

Watchers

Forks