aws / aws-lambda-base-images

Apache License 2.0
648 stars 107 forks source link

Invalid entrypoint when using aws-lambda-nodejs:14 #34

Open adamskicool opened 2 years ago

adamskicool commented 2 years ago

We are using the the image aws-lambda-nodejs:14 which seems to fail out of the blue.

The error message the lambda gets is: IMAGE Launch error: fork/exec /lambda-entrypoint.sh: exec format error Entrypoint: [/lambda-entrypoint.sh] Cmd: [src/index.handler] WorkingDir: [/var/task]

entest-hai commented 2 years ago
  1. What machine used to build the docker image? x86 or arm?
  2. When deploy which one selected x86 or arm?
  3. I got a similar problem, then I have to switch all to x86
enmanuelmag commented 2 years ago

@entest-hai I have this problem with ARM64, this is my configurations: This are the variables that change to use arm on serverless:

# serverless.yml
...
provider:
  name: aws
  architecture: arm64
  ecr:
    images:
      appimage:
        path: ./
...

And the config of Dockerfile

FROM public.ecr.aws/lambda/nodejs:14

COPY . ${LAMBDA_TASK_ROOT}/

RUN npm install --target ${LAMBDA_TASK_ROOT}