AWS Lambda now supports container images, allowing you to package applications with Docker for serverless execution without managing servers.
AWS Lambda originally supported ZIP file deployments, and now you can also upload container images—combining the portability of Docker with Lambda’s serverless execution model. With container images, you package your application code, dependencies, and configuration into a single, portable image. AWS then runs that image in a fully managed, serverless environment without you needing to manage servers or clusters.
Lambda container images support sizes up to 10 GB, so you can bundle large frameworks, machine learning models, or data-processing libraries.
Large image support opens the door to CPU- and memory-intensive workloads—everything from AI inference to ETL pipelines—without worrying about ZIP size limits.
To deploy a container image on Lambda, your Docker image must include the Lambda Runtime Interface Client (RIC) or Runtime Interface Emulator for local testing.
All Lambda container images require the Lambda Runtime Interface Client (RIC). Failing to include the RIC will cause your function to fail at invocation time.
Here’s a sample Dockerfile that uses the Python 3.9 managed runtime base image:
# Dockerfile exampleFROM public.ecr.aws/lambda/python:3.9# Copy application codeCOPY app.py ${LAMBDA_TASK_ROOT}# Set the command to run your handlerCMD ["app.handler"]
After building and pushing your image to Amazon ECR, simply create or update a Lambda function to point to that image:
By leveraging container images on AWS Lambda, you get the portability and tooling of Docker combined with a fully managed, auto-scaling, pay-per-use serverless environment. Whether you’re running microservices, data-processing jobs, or AI workloads, Lambda Containers offer flexibility and simplicity.