I think the equivalent for ubuntu, on Amazon Linux 2 (lambda is using it) would be:

FROM public.ecr.aws/lambda/nodejs:14

COPY index.js package.json cad/  ${LAMBDA_TASK_ROOT}

RUN yum install -y libgl1-mesa-devel libx11-devel  mesa-libGL-devel

RUN npm install

CMD ["index.handler"]
Answer from Marcin on Stack Overflow
๐ŸŒ
Docker Hub
hub.docker.com โ€บ r โ€บ amazon โ€บ aws-lambda-nodejs
amazon/aws-lambda-nodejs - Docker Image
AWS provided base images for Lambda contain all the required components to run your functions packaged as container images on AWS Lambda.
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws lambda โ€บ developer guide โ€บ building lambda functions with node.js โ€บ deploy node.js lambda functions with container images
Deploy Node.js Lambda functions with container images - AWS Lambda
March 9, 2023 - . When you deploy a container image to Lambda, Lambda automatically defines a default Linux user with least-privileged permissions. This is different from standard Docker behavior which defaults to the root user when no USER instruction is provided. FROM public.ecr.aws/lambda/nodejs:22 # Copy ...
Discussions

Using temporary folders with AWS Lambda

Sure, no problem. But /tmp is only 512 MB in a Lambda function, so keep that in mind...

https://docs.aws.amazon.com/lambda/latest/dg/limits.html

Since memory can be much higher (up to 3GB) you may just want to use memory constructs to hold your data.

More on reddit.com
๐ŸŒ r/aws
9
4
June 5, 2019
AWS Lambda - Python 3.6, pyodbc, and SQL Server driver - ODBC driver

Just to clarify, it works on your ec2 instance but not on your lambda? If so, I would go over https://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html On how to build the lambda deployment package. I recommend using virtualenv. You can also then go into the lambda console and start debugging once you've uploaded it. It might be useful to show your directory structure for your zip as well.

More on reddit.com
๐ŸŒ r/aws
6
7
July 12, 2018
๐ŸŒ
ECR Public Gallery
gallery.ecr.aws โ€บ lambda โ€บ nodejs
AWS Lambda/nodejs - Amazon ECR Public Gallery
Amazon ECR Public Gallery is a website that allows anyone to browse and search for public container images, view developer-provided details, and see pull commands
๐ŸŒ
GitHub
github.com โ€บ aws โ€บ aws-lambda-base-images
GitHub - aws/aws-lambda-base-images ยท GitHub
The older versions of our images remain present on DockerHub and Amazon ECR. To re-create the AWS Lambda base images, make sure you have the following pre-requisites set up: ... Then, checkout the branch relevant to the Lambda base image you want to build. eg. to build the nodejs18.x image, start by checking out the nodejs18.x branch:
Starred by 772 users
Forked by 114 users
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws lambda โ€บ developer guide โ€บ configuring aws lambda functions โ€บ create a lambda function using a container image
Create a Lambda function using a container image - AWS Lambda
To build efficient container images, follow the Best practices for writing Dockerfiles ... To create a Lambda function from a container image, build your image locally and upload it to an Amazon Elastic Container Registry (Amazon ECR) repository. If you're using a container image provided by ...
๐ŸŒ
Amazon Web Services
docs.aws.amazon.com โ€บ aws lambda โ€บ developer guide โ€บ building lambda functions with typescript โ€บ deploy transpiled typescript code in lambda with container images
Deploy transpiled TypeScript code in Lambda with container images - AWS Lambda
AWS provides base images for Node.js to help you build the container image. These base images are preloaded with a language runtime and other components that are required to run the image on Lambda. AWS provides a Dockerfile for each of the base images to help with building your container image.
Find elsewhere
๐ŸŒ
Docker
hub.docker.com โ€บ layers โ€บ amazon โ€บ aws-lambda-nodejs โ€บ latest โ€บ images โ€บ sha256-fd76e3e12a68312e83c3109bf83fe377e99b1bc99c9ea35b67b70a3005373264
Image Layer Details - amazon/aws-lambda-nodejs:latest
Welcome to the world's largest container registry built for developers and open source contributors to find, use, and share their container images. Build, push and pull.
๐ŸŒ
Sbstjn
sbstjn.com โ€บ blog โ€บ aws-lambda-container-docker-example
AWS Lambda Container Image Support example for Node.js | sbstjn.com
December 1, 2020 - For every new release, a GitHub action will build and tag a docker container image and push it to AWS ECR: Continuous Deployment With Github Action for AWS ECR ยท Afterwards, a GitHub action will update the AWS Lambda function to use new image using a CloudFormation template: Update CloudFormation with GitHub Actions
๐ŸŒ
Mendhak
code.mendhak.com โ€บ lambda-docker-hello-world
A hello world example using a Docker image in AWS Lambda
December 4, 2020 - To make use of Docker in Lambda, AWS provides a specific Docker image for NodeJS to base your image from.
๐ŸŒ
Medium
medium.com โ€บ platform-engineer โ€บ deploying-aws-lambda-functions-as-docker-container-images-53a699ee44f7
Deploying AWS Lambda Functions As Docker Container Images | by Thilina Ashen Gamage | Platform Engineer | Medium
July 9, 2021 - vi Dockerfile// Dockerfile FROM public.ecr.aws/lambda/nodejs:14 COPY helloWorldFunction.js package*.json ./ RUN npm install CMD [ "helloWorldFunction.handler" ] 4. Build the Lambda function as a Docker image. docker build -t hello-world-container .
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ serverless-architecture-with-aws-lambda
The Serverless Architecture Handbook: How to Publish a Node Js Docker Image to AWS ECR and Deploy the Container to AWS Lambda
April 17, 2025 - How to install the AWS CLI on your local machine and create AWS IAM users with the right permissions to push your Docker image to AWS Elastic Container Registry (ECR). Once the image is up and running on ECR, weโ€™ll then connect it to AWS Lambda and deploy the container to Lambda for a fully serverless experience.
๐ŸŒ
Medium
loginov-rocks.medium.com โ€บ building-node-js-lambda-with-dependencies-in-a-docker-container-68e7cb81c9a7
How to build and package Node.js Lambda code along with dependencies in Docker | by Danila Loginov | Medium
January 22, 2024 - It is important to understand that this approach enables the compilation of the Node.js code with any libraries and runtime dependencies needed within the Docker container without using the Docker in AWS Lambda at all. The result is a zip archive that can be easily uploaded to AWS. The BASE image ...
๐ŸŒ
Arbaz Khan
arbazdev.com โ€บ blog โ€บ deploying-nodejs-aws-lambda-docker
Deploying Node.js Applications on AWS Lambda with Docker - Arbaz Khan
November 6, 2025 - Docker containers give you more ... the official AWS Lambda base images for Node.js: FROM public.ecr.aws/lambda/nodejs:18 COPY package*.json ./ RUN npm ci --production COPY ....
๐ŸŒ
DEV Community
dev.to โ€บ slsbytheodo โ€บ deploy-your-first-node-20-lambda-function-on-aws-2ac1
Deploy your first Node 20 Lambda function on AWS! - DEV Community
November 15, 2023 - docker build --platform linux/amd64 -t lambda-image:node-20 . # tag the image with your own tag ยท Now that the image is built, we can push it to ECR. First, we need to create a repository in ECR. I will use the AWS CLI to do so.
๐ŸŒ
Medium
tylermarshall.medium.com โ€บ deploying-nodejs-lambda-function-with-internal-dependencies-using-docker-738314cd9bf3
Deploying NodeJS Lambda Function With Internal Dependencies Using Docker | by Tyler | Medium
January 17, 2025 - AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > sam-app Sample SAM Template for sam-app # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: Timeout: 3 Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: PackageType: Image Architectures: - x86_64 Events: HelloWorld: Type: Api Properties: Path: /hello Method: get Metadata: DockerTag: nodejs22.x-v1 DockerContext: ./hello-world Dockerfile: Dockerfile Outputs: # ServerlessRestApi is an implicit API create
๐ŸŒ
AWS
aws.amazon.com โ€บ blogs โ€บ aws โ€บ new-for-aws-lambda-container-image-support
New for AWS Lambda โ€“ Container Image Support | Amazon Web Services
November 3, 2022 - Now, I create a Dockerfile to create the container image for my Lambda function, starting from the AWS provided base image for the nodejs12.x runtime. All AWS provided base images are available in Docker Hub and ECR Public.
๐ŸŒ
Braincuber
braincuber.com โ€บ home โ€บ tutorials โ€บ how to deploy a node.js docker container to aws lambda
How to Deploy a Node.js Docker Container to AWS Lambda: Step by Step
March 7, 2026 - Head to the Lambda Console. Click Create function. Do not use author from scratch โ€” select Container image. Name your function. Click Browse images, select your ECR repository, and pick the latest tag you just pushed.