A small project to experiment with deploying Java applications to AWS Lambda with Docker.
The project is built with:
- Docker
- Java 11
- Gradle
- shadow plugin
The project will build and deploy a fat/uber JAR to the Lambda Docker container.
Included are a pair of basic shell scripts, build.sh
and run.sh
which will build and start the container locally:
- Build the Docker image:
docker build -t java-lambda-test:latest -f Dockerfile .
- Use Dockerfile.dev to just copy the locally built jar into the image for faster testing.
- Run the Docker image:
docker run -p 9000:8080 java-lambda-test:latest
- Use an API client or
curl
to invoke the Lambda:curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"name":"afwolfe", "id":1}'