https://github.com/mikesir87/aws-cli-docker
Simple Docker image with the AWS CLI
https://github.com/mikesir87/aws-cli-docker
Last synced: 2 months ago
JSON representation
Simple Docker image with the AWS CLI
- Host: GitHub
- URL: https://github.com/mikesir87/aws-cli-docker
- Owner: mikesir87
- Created: 2016-07-25T18:43:40.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-02T14:30:02.000Z (over 4 years ago)
- Last Synced: 2025-04-01T15:54:14.559Z (2 months ago)
- Language: Dockerfile
- Size: 334 KB
- Stars: 86
- Watchers: 3
- Forks: 45
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS CLI Docker Image


## Supported tags and Dockerfiles
- [2.1.6/v2/latest](https://github.com/mikesir87/aws-cli-docker/blob/2.1.6/Dockerfile)
- [1.18.188/v1](https://github.com/mikesir87/aws-cli-docker/blob/1.18.188/Dockerfile)
- [1.17.14](https://github.com/mikesir87/aws-cli-docker/blob/1.17.14/Dockerfile)
- [1.16.312](https://github.com/mikesir87/aws-cli-docker/blob/1.16.312/Dockerfile)
- [1.15.85](https://github.com/mikesir87/aws-cli-docker/blob/1.15.85/Dockerfile)
- [1.14.69](https://github.com/mikesir87/aws-cli-docker/blob/1.14.69/Dockerfile)
- [1.12.1](https://github.com/mikesir87/aws-cli-docker/blob/1.12.1/Dockerfile)
- [1.11.190](https://github.com/mikesir87/aws-cli-docker/blob/1.11.190/Dockerfile)
- [1.10.65](https://github.com/mikesir87/aws-cli-docker/blob/1.10.65/Dockerfile)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'
```