{"id":19777991,"url":"https://github.com/aleph0io/aws-lambda-java-base-images","last_synced_at":"2025-07-19T20:40:27.633Z","repository":{"id":195815654,"uuid":"530888496","full_name":"aleph0io/aws-lambda-java-base-images","owner":"aleph0io","description":"AWS Lambda Base Images for Java 17+","archived":false,"fork":false,"pushed_at":"2024-04-27T14:25:11.000Z","size":119,"stargazers_count":15,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-27T15:30:15.646Z","etag":null,"topics":["aws","aws-lambda","aws-lambda-java","java","java-17","java-18","java-19","java-20","java-21","lambda"],"latest_commit_sha":null,"homepage":"https://gallery.ecr.aws/aleph0io/lambda/java","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleph0io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-31T01:08:40.000Z","updated_at":"2023-12-11T15:57:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"7f4930bf-bbac-4869-a7ee-7619298b38f5","html_url":"https://github.com/aleph0io/aws-lambda-java-base-images","commit_stats":null,"previous_names":["aleph0io/aws-lambda-java-base-images"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Faws-lambda-java-base-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Faws-lambda-java-base-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Faws-lambda-java-base-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleph0io%2Faws-lambda-java-base-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleph0io","download_url":"https://codeload.github.com/aleph0io/aws-lambda-java-base-images/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224223128,"owners_count":17276130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-lambda","aws-lambda-java","java","java-17","java-18","java-19","java-20","java-21","lambda"],"created_at":"2024-11-12T05:27:23.951Z","updated_at":"2024-11-12T05:27:24.388Z","avatar_url":"https://github.com/aleph0io.png","language":"Dockerfile","readme":"# AWS Lambda Java Base Images\n\nThis project provides the missing [AWS Lambda base image](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-images.html) for Java 17, 18, 19, 20, and 21. The base images are publicly available [in the ECR Public Gallery](https://gallery.ecr.aws/aleph0io/lambda/java). You should be able to use them directly in your builds. I use these images in production for personal and commercial projects today, but per the license, there is no warranty, and YMMV.\n\n## Approach\n\nThis project uses the following process to create new Lambda base images:\n\n1. Define a Java maven POM that includes all the [Java Lambda support libraries](https://github.com/aws/aws-lambda-java-libs) as provided scope. This roundabout approach is used to coax @dependabot into flagging new versions as they are published.\n2. Also teach maven to collect these dependencies and build the appropriate docker images using a Dockerfile and the excellent [fabric8io/docker-maven-plugin](https://github.com/fabric8io/docker-maven-plugin).\n3. Use GitHub Actions to perform CI/CD and release new images to the ECR Public Gallery.\n\n## Example Lambda Function\n\nYou can find an example Lambda function using these base images at [aleph0io/example-java-lambda-function](https://github.com/aleph0io/example-java-lambda-function). It's just like building any container lambda function. For ease of use, find the `Dockerfile` below. Note the `FROM` image. Java versions 17-20 are also supported.\n\n    FROM public.ecr.aws/aleph0io/java/lambda:21-al2\n    \n    COPY target/hello-lambda.jar \"${LAMBDA_TASK_ROOT}/lib/\"\n    \n    CMD [ \"com.sigpwned.lambda.hello.HelloLambda::handleRequest\" ]\n\n## Testing Lambda Functions Locally\n\nThe [Lambda RIE](https://github.com/aws/aws-lambda-runtime-interface-emulator) is not currently built into these lambda base images, so to test your lambda function implementations locally, you will need to [use the standalone RIE server](https://docs.aws.amazon.com/lambda/latest/dg/images-test.html#images-test-add).\n\n## Known Issues and Future Plans\n\n* This image is in no way optimized for cold start time, size, etc. PRs welcome!\n* Java 17, 18, 19, 20, and 21 are all supported.\n* For now, only x86_64 is supported. I hope to publish multiarch builds including arm64 soon.\n* Official base images for Java 17 have been released to [lambda/java](https://gallery.ecr.aws/lambda/java). Java 17 users should strongly consider moving to the officially-supported base images. This project will continue to release updates for Java 17 on an ongoing basis for those who prefer not to move.\n* This project will continue to support non-LTS Java versions that will never receive an officially-supported AWS Lambda base image.\n\n## More Information\n\nYou can find writeups of the [Java 17](https://sigpwned.com/2022/07/23/aws-lambda-base-images-for-java-17/), [18](https://sigpwned.com/2022/08/31/aws-lambda-base-images-for-java-18-too/), [19](https://sigpwned.com/2022/09/21/aws-lambda-base-images-for-java-19/), [20](https://sigpwned.com/2023/03/24/community-managed-aws-lambda-base-images-for-java-20/), and [21](https://sigpwned.com/2023/09/19/java-21-custom-runtime-for-aws-lambda/) on [my blog](https://sigpwned.com/).\n\n## Acknowledgements\n\nMany 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!\n\nAlso, 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.\n\nManaged by [@sigpwned](https://github.com/sigpwned).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph0io%2Faws-lambda-java-base-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleph0io%2Faws-lambda-java-base-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleph0io%2Faws-lambda-java-base-images/lists"}