Skip to content

razamoh/aws-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AWS CLI

Docker image to run AWS CLI commands without having to install it on the host system.

Usage

Make a copy of the environment file.

$ cp env.sample env.dev # You can make it `env.prod` or anything you want.

Edit to add your own AWS credentials.

$ vim env.dev

Build your Docker image:

$ docker build \
    --rm \
    -t aws_cli \
    .

Run the aws_cli_container container off the aws_cli image, loading environment variables from the file env.dev into the container and specify your AWS command at the end:

$ docker run \
    --rm \
    -it \
    --name=aws_cli_container \
    -v ${PWD}:/app \
    --env-file ./env.dev \
    aws_cli \
    iam get-user

You can also create an alias for the Docker run command in your ~/.bashrc by adding this at the end:

alias aws='docker run --rm -it --name=aws_cli_container -v ${PWD}:/app --env-file ./env.dev aws_cli'

Then, source the file:

$ . ~/.bashrc

Then, you can just do:

$ aws iam get-user

About

AWS CLI on Docker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%