DirectorySecurity AdvisoriesPricing
/
Sign in
Directory
aws-lambda-python logo

aws-lambda-python

Last changed

Request a free trial

Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.

Tags
Overview
Comparison
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Chainguard Container for aws-lambda-python

Minimal base image to run Python applications on AWS Lambda.

Chainguard Containers are regularly-updated, secure-by-default container images.

Download this Container Image

For those with access, this container image is available on cgr.dev:

docker pull cgr.dev/ORGANIZATION/aws-lambda-python:latest

Be sure to replace the ORGANIZATION placeholder with the name used for your organization's private repository within the Chainguard Registry.

Usage

You can use this image as a base image for your Python Lambda application:

# Build stage
FROM cgr.dev/ORGANIZATION/python:latest-dev AS build-image
WORKDIR /function
COPY requirements.txt requirements.txt
RUN pip install \
    --target /function \
    -r requirements.txt && rm requirements.txt
COPY lambda_function.py lambda_function.py

# Runtime image stage
FROM cgr.dev/ORGANIZATION/aws-lambda-python
COPY --from=build-image /function /function
CMD [ "lambda_function.handler" ]
docker buildx build \
  --platform linux/amd64 \\
  --provenance=false \
  --push -t \
  ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/aws-lambda-python:test .

This will push a single-architecture image to ECR.

Note that, because Lambda doesn't support multi-architecture images, you must pass --platform. Also, because Lambda doesn't accept Docker's build provenance format, you must pass --provenance=false.

Next, you can deploy the image to Lambda:

aws lambda create-function \
  --function-name aws-lambda-python \
  --region REGION \
  --package-type Image \
  --code ImageUri=ACCOUNT_ID.dkr.ecr.REGION.amazonaws.com/jason-lambda-python:test \
  --role arn:aws:iam::ACCOUNT_ID:role/lambda-ex

Then you can invoke the function:

aws lambda invoke --function-name aws-lambda-python response.json

Then, to clean up, delete the function:

aws lambda delete-function --function-name aws-lambda-python

See https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-types for more information about using non-AWS base images with AWS Lambda.

To deploy an arm64 image, use --platform=linux/arm64 when building the image, and --architectures=arm64 when creating the function.

See https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html for more information.

What are Chainguard Containers?

Chainguard Containers are minimal container images that are secure by default.

In many cases, the Chainguard Containers tagged as :latest contain only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager. Chainguard Containers are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a more secure software supply chain.

The main features of Chainguard Containers include:

For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a -dev variant.

Although the -dev container image variants have similar security features as their more minimal versions, they feature additional software that is typically not necessary in production environments. We recommend using multi-stage builds to leverage the -dev variants, copying application artifacts into a final minimal container that offers a reduced attack surface that won’t allow package installations or logins.

Learn More

To better understand how to work with Chainguard Containers, please visit Chainguard Academy and Chainguard Courses.

In addition to Containers, Chainguard offers VMs and Libraries. Contact Chainguard to access additional products.

Trademarks

This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.

Licenses

Chainguard's container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:

  • Apache-2.0

  • BSD-2-Clause

  • GCC-exception-3.1

  • GPL-3.0-or-later

  • LGPL-2.1-or-later

  • MIT

  • MPL-2.0

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Compliance

Chainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.

SLSA compliance at Chainguard

This image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.

PCI DSS at Chainguard

A FIPS validated version of this image is available for FedRAMP compliance. STIG is included with FIPS image.


Related images
aws-lambda-python-fips logoFIPS
aws-lambda-python-fips

Category
Base

The trusted source for open source

Talk to an expert
© 2025 Chainguard. All Rights Reserved.
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsIntegrationsPricing