Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile to move handler and set command for Lambda function #1098

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wakame1367
Copy link
Contributor

What I am changing

  • Moving all files from the /asset directory into the Lambda task root (${LAMBDA_TASK_ROOT}).
  • Updating the CMD instruction to invoke the correct Lambda handler (handler.handler) instead of the placeholder echo command.

How I did it

  • Inserted the command RUN mv /asset/* ${LAMBDA_TASK_ROOT}/ in the Dockerfile to move all asset files to the correct directory.
  • Changed the CMD line from CMD ["echo", "hello world"] to CMD ["handler.handler"], ensuring AWS Lambda calls the proper function defined in handler.py.

How you can test it

  • Build the Docker image locally using the updated Dockerfile.
  • Run the image with the Lambda runtime interface emulator (or deploy to AWS Lambda) and invoke the function.
  • Verify that the Lambda function executes the handler from handler.py and returns the expected result.

Related Issues

  • (None)

@vincentsarago
Copy link
Member

Hi @wakame1367
Thanks for this PR. I'm not sure to get why those changes are needed?

Do you aim to use the docker image directly in AWS Lambda? We used the docker container just to build the lambda package (for the CDK app).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants