Sign inSign up

brainstation/awscli

By brainstation

•Updated over 2 years ago

Latest AWS CLI, both V1 & V2

Image
1

100K+

brainstation/awscli repository overview

⁠awscli

A docker image with AWSCLI installed

Docker build Docker Pulls

⁠Tag Pattern:

  • 2, latest, 2-amazonlinux, latest-amazonlinux
  • 2.x, 2.x-amazonlinux
  • 2.x.x, 2.x.x-amazonlinux
  • 2-ubuntu, latest-ubuntu
  • 2.x-ubuntu
  • 2.x.x-ubuntu
  • 1
  • 1.x
  • 1.x.x

Please find all available tags here⁠.

Docker Hub⁠

Tags of this project represent the release tags of awscli⁠. Whenever there is a new release tag available in awscli⁠, the latest will be updated and the new tag will be added within eight hour.

As this image is mainly useful in a CI context, jq⁠ is also provided in it, to parse some awscli response.

⁠Usage example

To be able to try these examples you need to have valid credentials in ~/.aws/credentials on your host machine. To set it up, you may follow the instructions here⁠.

⁠With docker
$ docker run \
--mount type=bind,src=$HOME/.aws,dst=/root/.aws \
--rm \
brainstation/awscli:2 \
aws sts get-caller-identity
{
  "UserId": "<user id>",
  "Account": "<account number>",
  "Arn": "<user or role arn>"
}
⁠With docker-compose

docker-compose.yml

version: '3'
services:
  who-am-i-1:
    image: brainstation/awscli:latest
    working_dir: /opt/code
    volumes:
      - .:/opt/code
      - $HOME/.aws:/root/.aws
    command: ./task.sh

  who-am-i-2:
    image: brainstation/awscli:latest
    volumes:
      - $HOME/.aws:/root/.aws
    command: bash -c -e "
      aws sts get-caller-identity &&
      echo \"Hello World!\"
      "

task.sh

#!/usr/bin/env bash

UserId=$(aws sts get-caller-identity | jq -r '.UserId')
echo "My user id: $UserId"

Execution output:

$ docker-compose run --rm who-am-i-1
My user id: ABCDEFG3H5IJK4NXYAYJ4
$ docker-compose run --rm who-am-i-2
{
  "UserId": "<user id>",
  "Account": "<account number>",
  "Arn": "<user or role arn>"
}
Hello World!

Tag summary

Content type

Image

Digest

sha256:9d4c9dd1c…

Size

277.2 MB

Last updated

over 2 years ago

docker pull brainstation/awscli