Skip to content

Docker in Docker image with AWS CLI v1/v2 support

License

Notifications You must be signed in to change notification settings

CheyiLin/docker-awscli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-awscli

Docker in Docker image with AWS CLI v1/v2 support

Upstream releases: github.com/aws/aws-cli

GitHub Release Date

Supported Platforms

  • linux/amd64
  • linux/arm64

Builds

  • v2
  • v1

Image Registry

GitHub Container Registry

ghcr.io/cheyilin/docker-awscli:<version-tag>

Docker Hub Docker Pulls

cheyilin/docker-awscli:<version-tag>

Examples

Start a Docker daemon dockerd

$ docker network create dind
$ docker run --privileged --rm --name=dockerd --network=dind --network-alias=docker -e DOCKER_TLS_CERTDIR= docker:20.10-dind

Connect to dockerd from docker-awscli

$ docker run -ti --rm --network=dind ghcr.io/cheyilin/docker-awscli:2.2.18

user@docker-awscli:/$ aws --version
aws-cli/2.2.18 Python/3.8.8 Linux/5.10.25-linuxkit exe/aarch64.debian.10 prompt/off

user@docker-awscli:/$ docker version
Client: Docker Engine - Community
 Version:           20.10.7
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        f0df350
 Built:             Wed Jun  2 11:57:26 2021
 OS/Arch:           linux/arm64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       b0f5bc3
  Built:            Wed Jun  2 11:57:00 2021
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.4.6
  GitCommit:        d71fcd7d8303cbf684402823e425e9dd2e99285d
 runc:
  Version:          1.0.0-rc95
  GitCommit:        b9ee9c6314599f1b4a7f497e1f1f856fe433d3b7
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Login and pull/push AWS ECR image within docker-awscli

Using Amazon ECR with the AWS CLI

user@docker-awscli:/$ aws ecr get-login-password --region AWS_REGION | docker login --username AWS --password-stdin AWS_ACCOUNT_ID.dkr.ecr.AWS_REGION.amazonaws.com
user@docker-awscli:/$ docker pull AWS_ACCOUNT_ID.dkr.ecr.AWS_REGION.amazonaws.com/hello-world:latest
user@docker-awscli:/$ docker push AWS_ACCOUNT_ID.dkr.ecr.AWS_REGION.amazonaws.com/hello-world:latest