Skip to content

Commit 98ce521

Browse files
committed
2 parents 6dacf38 + 870881c commit 98ce521

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AWS Lambda Java Base Images
22

3-
This project provides AWS Lambda function base images for Java 17. The base images are publicly available available [in the ECR Public Gallery](https://gallery.ecr.aws/m6n4d7c2/sigpwned/aws-lambda-java-base-image). You should be able to use them directly in your builds. I expect to use these base images for production lambda functions reasonably soon, but in the meantime please consider them to be *very experimental*.
3+
This project provides the missing [AWS Lambda base image](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-images.html) for Java 17. The base images are publicly available [in the ECR Public Gallery](https://gallery.ecr.aws/m6n4d7c2/sigpwned/aws-lambda-java-base-image). You should be able to use them directly in your builds. I expect to use these base images for production lambda functions reasonably soon, but in the meantime please consider them to be *very experimental*.
44

55
## Approach
66

@@ -10,14 +10,26 @@ This project uses the following process to create new Lambda base images:
1010
2. Also teach maven to collect these dependencies and build the appropriate docker images using the Dockerfile using the excellent [fabric8io/docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin).
1111
3. Use GitHub Actions to do perform CI/CD and release new images to the ECR Public Gallery.
1212

13+
## Example Lambda Function
14+
15+
You can find an example Lambda function using these base images at [sigpwned/example-java-17-lambda-function](https://github.com/sigpwned/example-java-17-lambda-function). It's just like building any container lambda function. For ease of use, find the `Dockerfile` below. Note the `FROM` image.
16+
17+
FROM public.ecr.aws/m6n4d7c2/sigpwned/aws-lambda-java-base-image:17.0.3-al2
18+
19+
COPY target/hello-lambda.jar "${LAMBDA_TASK_ROOT}/lib/"
20+
21+
CMD [ "com.sigpwned.lambda.hello.HelloLambda::handleRequest" ]
22+
1323
## Known Issues and Future Plans
1424

25+
* This image is in no way optimized for cold start time, size, etc. PRs welcome!
1526
* For now, only Java 17 is supported. I hope to provide base images for additional versions soon.
1627
* For now, only x86_64 is supported. I hope to publish multiarch builds including arm64 soon.
1728
* I suspect I will also clean up the ECR public gallery presence, but this gets the images out for now.
29+
* Of course, as soon as there *is* an offically-supported AWS Lambda base image for Java 17, everyone should use that instead! But this project should hopefully fill the gap in the meantime, and will (hopefully) support non-LTS Java versions that will never receive an officially-supported AWS Lambda base image by that time.
1830

1931
## Acknowledgements
2032

21-
Many thanks to @rieckpil for [his outstanding writeup of custom Lambda runtimes](https://rieckpil.de/java-aws-lambda-container-image-support-complete-guide/). That tutorial was the foundation and basis for this build. Cheers!
33+
Many thanks to [@rieckpil](https://github.com/rieckpil) for [his outstanding writeup of custom Lambda runtimes](https://rieckpil.de/java-aws-lambda-container-image-support-complete-guide/). That tutorial was the foundation and basis for this build. Cheers!
2234

23-
Also, thank you to @msailes for [the example Java 17 Lambda layer](https://github.com/msailes/lambda-java17-layer). This prior art was also critically important to understanding how best to integrate a new Java version into Lambda.
35+
Also, thank you to [@msailes](https://github.com/msailes) for [the example Java 17 Lambda layer](https://github.com/msailes/lambda-java17-layer). This prior art was also critically important to understanding how best to integrate a new Java version into Lambda.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ under the License.
8080
<plugin>
8181
<groupId>io.fabric8</groupId>
8282
<artifactId>docker-maven-plugin</artifactId>
83-
<version>0.40.1</version>
83+
<version>0.40.2</version>
8484
<executions>
8585
<execution>
8686
<id>docker-build</id>

0 commit comments

Comments
 (0)