Skip to content

Commit

Permalink
Update README with examples of dotnetcore2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mhart committed Feb 20, 2018
1 parent e8a50b1 commit ab1cbcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ same library versions that exist on AWS Lambda and then deploy using
the [AWS CLI](https://aws.amazon.com/cli/).

This project consists of a set of Docker images for each of the supported Lambda runtimes
(Node.js 0.10, 4.3 and 6.10, Python 2.7 and 3.6, Java 8, and Go 1.x).
(Node.js 0.10, 4.3 and 6.10, Python 2.7 and 3.6, Java 8, .NET Core 2.0, and Go 1.x).

There are also a set of build images that include packages like gcc-c++, git,
zip and the aws-cli for compiling and deploying.
Expand Down Expand Up @@ -50,10 +50,10 @@ docker run --rm -v "$PWD":/var/task lambci/lambda:nodejs6.10
docker run --rm -v "$PWD":/var/task lambci/lambda:python2.7

# Test on Python 3.6 with a custom file named my_module.py containing a my_handler function
docker run --rm -v $PWD:/var/task lambci/lambda:python3.6 my_module.my_handler
docker run --rm -v "$PWD":/var/task lambci/lambda:python3.6 my_module.my_handler

# Test on Go 1.x with a compiled handler named my_handler and a custom event
docker run --rm -v $PWD:/var/task lambci/lambda:go1.x my_handler '{"some": "event"}'
docker run --rm -v "$PWD":/var/task lambci/lambda:go1.x my_handler '{"some": "event"}'

# Test a function from the current directory on Java 8
# The directory must be laid out in the same way the Lambda zip file is,
Expand All @@ -62,6 +62,10 @@ docker run --rm -v $PWD:/var/task lambci/lambda:go1.x my_handler '{"some": "even
# The default handler is "index.Handler", but you'll likely have your own package and class
docker run --rm -v "$PWD":/var/task lambci/lambda:java8 org.myorg.MyHandler

# Test on .NET Core 2.0 given a test.dll assembly in the current directory,
# a class named Function with a FunctionHandler method, and a custom event
docker run --rm -v "$PWD":/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler '{"some": "event"}'

# Run custom commands on the default container
docker run --rm --entrypoint node lambci/lambda -v
```
Expand All @@ -81,6 +85,10 @@ docker run --rm -v "$PWD":/var/task lambci/lambda:build-nodejs6.10
# To resolve dependencies on go1.x (working directory is /go/src/handler, will run `dep ensure`)
docker run --rm -v "$PWD":/go/src/handler lambci/lambda:build-go1.x

# For .NET Core 2.0, this will publish the compiled code to `./pub`,
# which you can then use to run with `-v "$PWD"/pub:/var/task`
docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub

# Run custom commands on a build container
docker run --rm lambci/lambda:build aws --version

Expand Down Expand Up @@ -184,6 +192,7 @@ Docker tags (follow the Lambda runtime names):
- `build-python3.6`
- `build-java8`
- `build-go1.x`
- `build-dotnetcore2.0`

Env vars:
- `AWS_LAMBDA_FUNCTION_NAME`
Expand Down
2 changes: 1 addition & 1 deletion examples/dotnetcore2.0/Function.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub

// Run with:
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
// docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler '{"some": "event"}'

using System;
using System.Collections;
Expand Down
2 changes: 1 addition & 1 deletion examples/dotnetcore2.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
docker run --rm -v "$PWD":/var/task lambci/lambda:build-dotnetcore2.0 dotnet publish -c Release -o pub

# Then you can run using that as the task directory
docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler "some"
docker run --rm -v "$PWD"/pub:/var/task lambci/lambda:dotnetcore2.0 test::test.Function::FunctionHandler '{"some": "event"}'
```

0 comments on commit ab1cbcb

Please sign in to comment.