Using Serverless Framework to build and deploy Docker images for AWS Lambdas

AWS Lambdas can be packaged and deployed using a Docker image, described in the docs here. Serverless Framework makes building and deploying a Docker based Lambda incredibly simple. If you have a simplest Dockerfile like this (from the docs here): FROM public.ecr.aws/lambda/nodejs:14 # Assumes your function is named “app.js”, and there is a package.json file …

Mounting a volume from the host into a Docker container

Assuming you have a folder called /data that you want to mount and access within a Docker container, you can so this a couple of ways, but the easiest is to specify when you start the container as a bind mount, with: docker run –volume /host-path:/container-path:[rw|ro] imagename –volume More info and options in the docs …