docker-lambda  by lambci

Deprecated: Docker images for replicating the AWS Lambda environment locally

created 9 years ago
5,807 stars

Top 9.0% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides Docker images that precisely replicate the AWS Lambda execution environment, enabling developers to test and build their serverless functions locally with high fidelity. It targets developers seeking reproducible testing and CI environments for AWS Lambda functions across various runtimes.

How It Works

The project achieves environment replication by creating Docker images based on AWS Lambda's underlying filesystem structure, including specific software versions, file permissions, and environment variables. It uses a "tarballing" approach to capture the Lambda filesystem and then builds Docker images from this base, mocking out native modules that interact with AWS services. This allows for accurate simulation of Lambda behavior, including cold starts and runtime specifics.

Quick Start & Requirements

  • Primary install/run command: docker run --rm -v <code_dir>:/var/task:ro,delegated lambci/lambda:<runtime> [<handler>] [<event>]
  • Prerequisites: Docker installed.
  • Links: AWS Lambda Base Images, ECR Public Gallery

Highlighted Details

  • Supports numerous Lambda runtimes (Node.js, Python, Java, Go, .NET Core, Ruby, Provided).
  • Offers "stay-open" API mode for faster, repeated invocations without cold starts.
  • Includes build-* images with development tools (GCC, AWS CLI, SAM CLI, etc.) for compiling native dependencies.
  • Supports local development with code watching for automatic restarts on file changes.

Maintenance & Community

This project is archived and deprecated. Users are directed to use AWS's official Lambda base images.

Licensing & Compatibility

The project's licensing is not explicitly stated in the README, but it is provided as-is due to its archived status. Compatibility with commercial or closed-source projects is not guaranteed given its deprecated nature.

Limitations & Caveats

The project is deprecated and will not receive further updates. Some older runtimes have limitations with the code-watching feature, requiring a Docker restart on file changes. The exact set of missing files/permissions compared to the live Lambda environment is not fully documented.

Health Check
Last commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
3 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.