Running temporal proxy server in docker

Hi Team,

  1. I am using the grpc-proxy for temporal server sample and creating a docker image of the proxy server.
    samples-go/grpc-proxy at main · temporalio/samples-go · GitHub

  2. I am launching temporal server using docker locally.

  3. Starting a temporal worker (samples-go/grpc-proxy/worker at main · temporalio/samples-go · GitHub) that connects to the proxy server fails with the error (samples-go/main.go at main · temporalio/samples-go · GitHub):

Unable to create client failed reaching server: last connection error: connection error: desc = "error reading server preface: EOF"
exit status 1

Checks done:
From inside container, I am able to connect to Temporal server on host via grpcurl.

[temporal@272f49ab960d /]$ grpcurl -plaintext -d '{"service": "temporal.api.workflowservice.v1.WorkflowService"}' host.docker.internal:7233 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

From host, I am able to connect on the temporal proxy on port:

% telnet 127.0.0.1 55003
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

On host:

docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                                                                         NAMES
272f49ab960d   t-proxy-server:latest           "/home/temporal/temp…"   4 seconds ago    Up 3 seconds    0.0.0.0:55003->5021/tcp, :::55003->5021/tcp                                                   proxy-new
a3d0acfa58ed   strm/helloworld-http            "/main.sh"               33 minutes ago   Up 33 minutes   0.0.0.0:80->80/tcp, :::80->80/tcp                                                             trusting_fermat
694fbf0c9830   temporalio/ui:2.9.0             "./start-ui-server.sh"   5 weeks ago      Up 5 hours      0.0.0.0:8080->8080/tcp, :::8080->8080/tcp                                                     temporal-ui
a9ac55419b22   temporalio/admin-tools:1.19.0   "tail -f /dev/null"      5 weeks ago      Up 5 hours                                                                                                    temporal-admin-tools
d20e12c89f5d   temporalio/auto-setup:1.19.0    "/etc/temporal/entry…"   5 weeks ago      Up 5 hours      6933-6935/tcp, 6939/tcp, 7234-7235/tcp, 7239/tcp, 0.0.0.0:7233->7233/tcp, :::7233->7233/tcp   temporal
0f15131a1f60   elasticsearch:7.16.2            "/bin/tini -- /usr/l…"   5 weeks ago      Up 5 hours      9200/tcp, 9300/tcp                                                                            temporal-elasticsearch
5f2dc7dfbe39   postgres:13                     "docker-entrypoint.s…"   5 weeks ago      Up 5 hours      5432/tcp                                                                                      temporal-postgresql
2ec07f94ac4d   redis                           "redis-server --appe…"   5 months ago     Up 5 hours      0.0.0.0:6379->6379/tcp, :::6379->6379/tcp                                                     redis

Any guidance on what I could be doing wrong?

Thanks!

Have you removed the loopback IP binding here?

127.0.0.1 won’t work inside of a container. For more context: Cannot connect to Go GRPC server running in local Docker container - Stack Overflow

Thanks @taonic .
Removing the loopback ip binding fixed this issue.

1 Like