5

I'm trying to run the pub/sub emulator in a docker container But I can't reach it with my application in another docker

I've tried to set my env as
ENV PUBSUB_EMULATOR_HOST="localhost:8085"
or
ENV PUBSUB_EMULATOR_HOST="pubsub:8085"
with pubsub the name of the container running the emulator
Both of the containers are in the same network

I can ping the container running the emulator from the other one but when I try to create a topic I get the following error:

503 failed to connect to all addresses
The script to create the topic were working when I ran the emulator locally

Of course, I'm running the pubsub container with -p 8085:8085

Anyone would have an idea of the problem ?

RDub
  • 61
  • 5
  • Does this answer your question? [Access to mysql container from other container](https://stackoverflow.com/questions/35429920/access-to-mysql-container-from-other-container) – Ali Tou Oct 30 '20 at 17:24
  • Did you try 0.0.0.0:8085? – guillaume blaquiere Oct 30 '20 at 19:47
  • Did you create a docker network and attached both containers to that network? Otherwise they will not be able to talk to each other. – camba1 Oct 30 '20 at 21:40
  • Yes, both container are attached to the same network – RDub Oct 31 '20 at 08:27
  • I did try with 0.0.0.0:8085, still not working – RDub Oct 31 '20 at 08:28
  • It's working when I use the network host – RDub Oct 31 '20 at 13:33
  • Pub/Sub library uses grpc instead of http, the `503 failed to connect to all addresses` is usually returned by the library when is trying to connect trough ipv6 but the endpoint is ipv4 (check this [thread](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/2638), could you please share the full error messages you are receiving? – Messier_31 Nov 24 '20 at 17:20

0 Answers0