Create multiple Lambda functions using single docker image

Published: 05 October 2023
on channel: The iT Tech Solutions
1,531
16

Create multiple Lambda functions using single docker image

Let's learn how to deploy multiple lambda functions using docker image. Here we will be using a single docker image to deploy two AWS lambda functions and create them in AWS using console.
We will use docker desktop to create docker image for lambda and deploy it to ECR and create the lambda using this image

How to setup AWS CLI on Windows:    • Install AWS CLI on Windows  
How to install Docker Desktop on Windows:    • Install Docker Desktop on Windows  
How to deploy a lambda using docker image:    • Create a Lambda using Docker Image and Ama...  

Sample docker file:
FROM public.ecr.aws/lambda/python:3.11
Copy files to root of the image
COPY . .
Install the specified packages
RUN pip install -r requirements.txt

Sample Docker Commands:
1. docker build --platform linux/amd64 -t docker-image:test .
2. aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 111122223333.dkr.ecr.us-east-1.amazonaws.com
3. aws ecr create-repository --repository-name hello-world --image-scanning-configuration scanOnPush=true --image-tag-mutability MUTABLE
4. docker tag docker-image:test 111122223333.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest
5. docker push 111122223333.dkr.ecr.us-east-1.amazonaws.com/hello-world:latest
6. create the function using console


On this page of the site you can watch the video online Create multiple Lambda functions using single docker image with a duration of hours minute second in good quality, which was uploaded by the user The iT Tech Solutions 05 October 2023, share the link with friends and acquaintances, this video has already been watched 1,531 times on youtube and it was liked by 16 viewers. Enjoy your viewing!