1

I will use a Docker image to launch Lambda. and I want to pass arguments at startup.

But in order to launch lambda, I need to add the handler name to the CMD.

How can I solve this?

Lang: Node.js

Dockerfile:

FROM amazon/aws-lambda-nodejs:12
COPY . ${LAMBDA_TASK_ROOT}
RUN npm install

CMD ["index.handler"] // success
CMD ["index.handler","arguments"] // Error: entrypoint requires the handler name to be the first argument

index.js

exports.handler = async () => {
  console.log(process.argv[2]);
}
Rick
  • 89
  • 1
  • 7

0 Answers0