项目作者: Ali-Shaikh

项目描述 :
Docker Container with AWS CLI and AWS EB CLI
高级语言: Dockerfile
项目地址: git://github.com/Ali-Shaikh/aws-ebcli-docker.git
创建时间: 2021-01-14T16:42:14Z
项目社区:https://github.com/Ali-Shaikh/aws-ebcli-docker

开源协议:MIT License

下载



Docker Cloud Build Status

Docker Pulls
Docker Image Size (latest by date)

Docker Cloud Automated build
Docker Image Version (latest by date)

Docker Container with AWS CLI and AWS Elatic Beanstalk (EB) CLI

A container for running:

  • AWS CLI
  • AWS EB CLI
  • Pyhton 3
  • pip
  • Git

Use it to deploy your applications from CLI or use the image in your CI/CD pipelines.

Docker Pull Command

docker pull alishaikh/aws-ebcli

Running - In a CLI

To run the CLI tools, use the CLI command just like you normally would. The combination of -w and -v mounts your PWD into the container as the current working directory for the EB CLI. If you’re on Windows you’ll want to use %cd% instead of $PWD.

  1. docker run -i -w /work -v $PWD:/work alishaikh/aws-ebcli eb --version
  2. docker run -i alishaikh/aws-ebcli aws --version
  3. docker run -i -w /work -v $PWD:/work alishaikh/aws-ebcli eb create test-app-${BUILD_NUMBER}
  4. docker run -i alishaikh/aws-ebcli aws ec2 describe-instances --region=us-east-1

To provide credentials, you have 2 options:

  1. Use -e to export all your AWS creds env vars
  2. Mount your ~/.aws directory to the docker container

Example with -e

  1. docker run -i -w /work -v $PWD:/work -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN alishaikh/aws-ebcli eb status
  2. docker run -i -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN alishaikh/aws-ebcli aws ec2 describe-instances --region=us-east-1

Example with mounting ~/.aws

PowerShell

docker run -i -w /work -v ${PWD}:/work -v $env:USERPROFILE/.aws:/root/.aws alishaikh/aws-ebcli eb status

Command Promt (CMD)

docker run -i -w /work -v %cd%:/work -v %userprofile%/.aws:/root/.aws alishaikh/aws-ebcli eb status

Linux

docker run -i -w /work -v $PWD:/work -v ~/.aws:/root/.aws alishaikh/aws-ebcli eb status