Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running scripts in a container #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3

WORKDIR /root

COPY requirements.txt ./

RUN pip install -r requirements.txt

COPY . .

VOLUME .aws

ENTRYPOINT ["python"]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,20 @@ pipenv install
```bash
pip install -r requirements.txt
```

## Using Docker

A Dockerfile is included that will run a python container with the appropriate requirements installed. There is also a convenience script included that will mount your AWS credentials file into the container and run your command.

### Docker

```bash
docker build -t aws-fast-fixes .
docker run -it --rm -v PATH_TO_AWS_CREDENTIALS_FILE:/root/.aws/credentials:ro aws-fast-fixes COMMAND
```

### Script

```bash
./docker.sh COMMAND
```
11 changes: 11 additions & 0 deletions docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

BUILD_NAME="aws-fast-fixes"
CREDENTIALS_PATH="$HOME/.aws/credentials"
DOCKER_ARGS="-v ${CREDENTIALS_PATH}:/root/.aws/credentials:ro"

DOCKER_ARGS="${DOCKER_ARGS}"
docker build -t ${BUILD_NAME} .
IMAGE=${BUILD_NAME}

docker run -it --rm ${DOCKER_ARGS} ${IMAGE} "$@"