Skip to content

curl: (52) Empty reply from server #26

Closed
@momotaro98

Description

@momotaro98

Env

MacOS: 10.15.7
Docker on Mac: Version 18.06.1-ce-mac73 (26764).
Docker Engin: Engine: 18.06.1-ce

Premise

Dockerfile

FROM public.ecr.aws/lambda/provided:al2
COPY bin/search_tutor /search_tutor
ENTRYPOINT [ "/search_tutor" ]

search_tutor is just a binary file built by Golang.

The app Lambda is for API Gateway integration and has the same structure with https://docs.aws.amazon.com/lambda/latest/dg/golang-handler.html

docker build -t myfunction:latest .
docker run -p 9000:8080 --env-file ./env.list myfunction:latest
$ docker ps
94685e614c95        myfunction:latest                                     "/search_tutor"          8 minutes ago       Up 8 minutes        0.0.0.0:9000->8080/tcp             myfunction

I confirmed Go app initialization is finished. Also, it seems Go app is listening for requests.

Problem

When I call the docker from my local of RIE like below.

curl -XPOST "http://localhost:9000/215-03-31/functns/function/invocations" -d '{}'

I'm getting the following error.

curl: (52) Empty reply from server

I understand it's network issue between host and the docker container but I don't know the root cause and how to debug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions