Skip to content

Commit

Permalink
Merge pull request #80 from Nike-Inc/fix/update-readme-build-guidance
Browse files Browse the repository at this point in the history
Update README to reflect current local testing and building considerations
  • Loading branch information
IamfromSpace authored Feb 15, 2021
2 parents de1bc98 + a4c5ff5 commit 9a9bf6f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ executables:
# ...
```

You'll need to either build on a compatible linux host or inside a compatible docker container (or some other mechanism like nix).
Note that current Stack LTS images are _not_ compatible.
If you see an error message that contains "version 'GLIBC_X.XX' not found" when running (hosted or locally), then your build environment is not compatible.

Enable stack's docker integration and define an optional image within stack.yaml:

```yaml
# file: stack.yaml
docker:
enabled: true
# If omitted, this defaults to fpco/stack-build:lts-${YOUR_LTS_VERSION}
image: ${BUILD_IMAGE}
```
Don't forget to define your [CloudFormation] stack:
```yaml
Expand Down Expand Up @@ -164,7 +178,6 @@ aws lambda invoke \

- [Stack][stack.yaml]
- [Docker]
- [aws-sam-cli] (>v0.8.0)

### Build

Expand All @@ -173,7 +186,18 @@ docker pull fpco/stack-build:lts-{version} # First build only, find the latest v
stack build --copy-bins
```

### Execute
### Execute w/ Docker

```bash
echo '{ "accountId": "byebye" }' | docker run -i --rm \
-e DOCKER_LAMBDA_USE_STDIN=1 \
-v ${PWD}/.stack-work/docker/_home/.local/bin/:/var/task \
lambci/lambda:provided
```

### Execute w/ SAM Local

Note that hal currently only supports [aws-sam-cli] on versions <1.0.

```bash
echo '{ "accountId": "byebye" }' | sam local invoke --region us-east-1
Expand Down

0 comments on commit 9a9bf6f

Please sign in to comment.