Building a custom docker image for AWS lambda deployment

I’m writing a serverless lambda which requires a custom docker. This is the dockerfile I wrote:

FROM node:14.16.1-alpine

RUN apk update && apk add git openssh-client vim python py-pip jq
RUN pip install awscli
RUN apk add automake autoconf libtool dpkg pkgconfig nasm libpng
RUN apk --purge -v del py-pip

RUN apk add --no-cache yarn

RUN rm /var/cache/apk/*

COPY package.json ./
COPY yarn.lock ./
RUN HOME=/kaniko/ yarn install --frozen-lockfile

RUN yarn build

I also looked at

And I have 2 questions:

  1. should I install AWS Lambda runtime API? in the Dockerfile

  2. should I include a CMD as the end of the Dockerfile? to run serverless? or will it be done automatically?
    Or maybe add ENTRYPOINT for running serverless?

Please advise.