Code Monkey home page Code Monkey logo

aws-cli-docker's Introduction

AWS CLI Docker Image

Docker Stars Docker Pulls Docker Automated Builds

Supported tags and Dockerfiles

This image provides the AWS CLI and a few other tools, including jq.

I have an IFTT recipe written to notify me of new releases of the AWS CLI, so should be able to keep up-to-date on it.

Providing Credentials

Credentials can be provided in any of the aws-cli supported formats.

Using credentials file

If you need to create the credentials file, you can use the aws-cli configure command by using the following command:

docker run --rm -tiv $HOME/.aws:/root/.aws mikesir87/aws-cli aws configure

From that point on, simply mount the directory containing your config.

docker run --rm -v $HOME/.aws:/root/.aws mikesir87/aws-cli aws s3 ls

Using environment variables

This is supported, although NOT encouraged, as the environment variables can end up in command-line history, available for container inspection, etc.

  • AWS_ACCESS_KEY_ID` - specify the access key ID
  • AWS_SECRET_ACCESS_KEY` - the secret access key
docker run --rm -e AWS_ACCESS_KEY_ID=my-key-id -e AWS_SECRET_ACCESS_KEY=my-secret-access-key -v $(pwd):/aws mikesir87/aws-cli aws s3 ls 

Using the container as a CLI command

You can setup an alias for aws to simply start a container, hiding the fact that it's not actually installed on the machine. Then, updating the version simply becomes a docker pull mikesir87/aws-cli.

alias aws='docker run --rm -tiv $HOME/.aws:/root/.aws -v $(pwd):/aws mikesir87/aws-cli aws'

aws-cli-docker's People

Contributors

adrianomitre avatar mb16 avatar mikesir87 avatar nvllsvm avatar pgbezerra avatar vtknightmare avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

aws-cli-docker's Issues

Install wget in this image

Before Debian image change, this docker image had wget.
I think that deserves to keep this program in your image.

Thank you!

Using aws-cli in Kubernetes pod

Trying to use the aws-cli container in Kubernets pod - I have the below config, but it does NOT work

Essentially I am trying to pass the environment credentials from Kubernetes secrets and run the aws cli commands from within the Kubernetes pod

apiVersion: batch/v1beta1 kind: CronJob metadata: name: "pcwlog" namespace: owaspzapscanner spec: schedule: "*/5 * * * *" concurrencyPolicy: Forbid jobTemplate: spec: template: spec: volumes: - name: owasp-zap-volume persistentVolumeClaim: claimName: efs containers: - name: aws-cli image: mikesir87/aws-cli:latest env: - name: AWS_ACCESS_KEY_ID valueFrom: secretKeyRef: name: aws-fastly-secret key: aws_access_key_id - name: AWS_SECRET_ACCESS_KEY valueFrom: secretKeyRef: name: aws-fastly-secret key: aws_secret_access_key command: ["/bin/sh", "-c"] args: ["aws s3 ls"] imagePullPolicy: Always name: "pcwlog" resources: {} volumeMounts: - name: owasp-zap-volume mountPath: /zap/wrk restartPolicy: Never securityContext: fsGroup: 1000

Not able to upload on s3 bucket

Hi,
I am trying to upload some files from my docker container to s3 bucket which is managed by rook. But while uploading it is not able to detect exact path for the object.

docker run --env AWS_ACCESS_KEY_ID=xyz --env AWS_SECRET_ACCESS_KEY=abc mikesir87/aws-cli aws --endpoint-url https://s3.company.com --no-verify-ssl s3 cp filename.txt s3://teamfelgen/test/

Result
The user-provided path filename.txt does not exist.

But I am in the same folder where this file is present.
Also I tried to put exact path from home directory like
~/piyush/filename.txt
/piyush/filename.txt

Note: Same command with aws cli is working as expected
aws --endpoint-url https://s3.company.com --no-verify-ssl s3 cp filename.txt s3://teamfelgen/test/

[Errno 2] No such file or directory: '/root/.aws/credentials' on macOS

Hi, nice work on this repo.

I tried to execute the configure command but I got this error message:

docker run --rm -tiv $HOME/.aws:/root/.aws -v $(pwd):/aws mikesir87/aws-cli aws configure
[Errno 2] No such file or directory: '/root/.aws/credentials'

Do you know how I can solve it?

Problem with configure command in documentation, returns EOF

I ran the configure command in your documentation:

docker run --rm -v $HOME/.aws:/root/.aws mikesir87/aws-cli aws configure

and received the following error: EOF when reading a line. This was done on a Mac in a bash terminal.
The solution was to add a "ti" switch.

docker run --rm -tiv $HOME/.aws:/root/.aws mikesir87/aws-cli aws configure

Please add a note in your documentation for others who might encounter this error.

add unzip to v2

The tool unzip was removed -- non-intentionally, I guess -- from v2.

Contrast this

$ docker run -it mikesir87/aws-cli:v1
/aws # unzip
BusyBox v1.31.1 () multi-call binary.

Usage: unzip [-lnojpq] FILE[.zip] [FILE]... [-x FILE...] [-d DIR]

Extract FILEs from ZIP archive

	-l	List contents (with -q for short form)
	-n	Never overwrite files (default: ask)
	-o	Overwrite
	-j	Do not restore paths
	-p	Print to stdout
	-q	Quiet
	-x FILE	Exclude FILEs
	-d DIR	Extract into DIR

to this (2.0.6/v2/latest as of now)

$ docker run -it mikesir87/aws-cli:v2
root@a93ba6fa2b39:/aws# unzip
bash: unzip: command not found

debian-security stable/updates Release does not have a Release file.

Hello,
I'm trying to run apt-get update and getting this error:

/aws# apt-get update
Get:1 http://deb.debian.org/debian stable InRelease [113 kB]
Get:2 http://deb.debian.org/debian stable-updates InRelease [36.8 kB]
Get:3 http://deb.debian.org/debian stable/main amd64 Packages [8178 kB]
Ign:4 http://security.debian.org/debian-security stable/updates InRelease
Err:5 http://security.debian.org/debian-security stable/updates Release
  404  Not Found [IP: 151.101.194.132 80]
Reading package lists... Done
E: The repository 'http://security.debian.org/debian-security stable/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Maybe is related to: debuerreotype/docker-debian-artifacts#134

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.