Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
Expose a handler function to Lambda from a Docker Image

I'm trying to build a hello world example of a docker image powering a lambda function.

My docker image houses a NPM project that looks like this:

project
│   app.js
|   Dockerfile
|   package.json
|   package-lock.json

The code inside app.js is:

// app.js
module.exports.lambdaHandler = async (event, context) => {
  console.log('Code Running Inside Handler Function');
  console.log(event);
  console.log(context);
  return "Hello World.";
}

I dockerize my app with this CMD layer in my docker file:

CMD [ "app.lambdaHandler" ]

I upload the docker image to AWS and try to run it as a lambda function. However I get the follow runtime error:

Cannot find module '/project/app.lambdaHandler'

How am I supposed to expose 'lambdaHandler' to aws?

Edit to include my docker file:

FROM node:16

COPY app.js ./

CMD [ "app.lambdaHandler" ]
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

When using custom image for AWS lambda container, some steps have to be undertaken to prepare it for a lambda environment. They include, among other things:

  • Installing the runtime interface client.
  • Setting the ENTRYPOINT property to invoke the runtime interface client.

But the easiest way would be to use AWS provided base images.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda