diff --git a/.env.dist b/.env.dist new file mode 100644 index 0000000..f99d65c --- /dev/null +++ b/.env.dist @@ -0,0 +1,3 @@ +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION= diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c49bd7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env diff --git a/CHANGELOG.md b/CHANGELOG.md index 72ee17c..00dd0e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) -## [1.0.1] - 2019-08-13 -### Added -- Changelog - ## [1.0.0] - 2019-08-13 ### Added - Initial release diff --git a/Dockerfile b/Dockerfile index de69b94..9d2ca44 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,16 @@ FROM alpine:3.10.1 -RUN apk add --update py-pip groff +RUN apk add --update py-pip groff && \ + pip install awscli --upgrade --user -RUN pip install awscli --upgrade --user +ARG AWS_ACCESS_KEY_ID +ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} + +ARG AWS_SECRET_ACCESS_KEY +ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + +ARG AWS_DEFAULT_REGION +ENV AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} ENV PATH /root/.local/bin:$PATH diff --git a/README.md b/README.md index d3690f7..057c73b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,31 @@ [![Build Status](https://travis-ci.org/mikaint/aws-cli-docker.svg?branch=master)](https://travis-ci.org/mikaint/aws-cli-docker) # AWS CLI (dockerized) +A docker image with AWS CLI installed. + +## Configuration +The first step in order to use AWS CLI image is to set the required environmental variables to be used in the container. +``` +cp .env.dist .env +``` +Edit .env file with your values (can be obtained from AWS IAM) + +## How to use + + +Default command is `--version` so if you run +``` +docker run mikaint/awscli +``` +you'll get something like +``` +aws-cli/1.16.216 Python/2.7.16 Linux/4.9.184-linuxkit botocore/1.12.206 +``` +The above command will run even without setting your configuration values as it will not make a request to AWS + +In order to run any other command that will make a request to AWS you'll need to specify your file that contains the configuration values +``` +docker run --env-file=.env mikaint/awscli ec2 describe-instances +``` +For a full list of available commands please check the official AWS CLI [documentation page](https://docs.aws.amazon.com/cli/index.html) +