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
Sur cette page du site, vous pouvez voir la vidéo en ligne Create multiple Lambda functions using single docker image durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur The iT Tech Solutions 05 octobre 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,531 fois et il a aimé 16 téléspectateurs. Bon visionnage!