Skip to content

Order of --entrypoint in example appears incorrect #31

Closed
@gwk

Description

@gwk

After much frustration, I just discovered that the following command in the readme does not quite work: docker run -d -v ~/.aws-lambda-rie:/aws-lambda -p 9000:8080 myfunction:latest --entrypoint /aws-lambda/aws-lambda-rie <image entrypoint> <(optional) image command>

On Docker version 20.10.5, build 55c4c88 for Mac (apple silicon), docker run appears to completely ignore the --entrypoint argument unless it is written before the image name.

Here is what ended up working for me:

docker run \
	--detach \
	--volume ~/.aws-lambda-rie:/aws-lambda \
	--publish 9000:8080 \
	--entrypoint /aws-lambda/aws-lambda-rie \
	myfunction:latest \
	/usr/local/bin/python3 -m awslambdaric func.handler

Where func.handler refers to a file func.py that contains:

def handler(event, context):
  return "My handler result."

If you agree, please update the readme. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions