1

I have read extensively about this mysterious lambda-entrypoint.sh. Apparently it is part of the lambda base image and neeeds to be referenced/invoked in the Dockerfile ?

But I can not find a working template for it. Here is my Dockerfile and the results of using it to run a Containerized Lambda function:

# Use the official Python runtime as a parent image
FROM public.ecr.aws/lambda/python:3.11

WORKDIR /var/task

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY service /var/task/service
COPY lambda_function.py .
COPY *.py .

CMD ["lambda_function.lambda_handler"]

ENTRYPOINT ["/lambda-entrypoint.sh"]

The build command is:

docker build --platform linux/amd64 -t 123456.dkr.ecr.us-east-1.amazonaws.com/cdk-hnb659fds-container-assets-7890-us-east-1:my-user-metrics6 .

Here is the output of running a test event:

 {
  "errorType": "Runtime.InvalidEntrypoint",
  "errorMessage": "RequestId: 8ba540c9-9877-4a90-b094-e2836fd0bbc4 Error: fork/exec /lambda-entrypoint.sh: exec format error"
}

1 Answer 1

1

The problem was completely different: I had selected ARM (based on a misunderstanding of the platform). By allowing the default X86 this error went away.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.