I am trying to subscribe to a topic running in a pubsub emulator running on my host machine.
I start up the emulator and it starts on port 8085.
Then I start the container using a docker-compose.yaml I set the environment variables:
environment: - PUBSUB_EMULATOR_HOST=0.0.0.0:8085 - PUBSUB_PROJECT_ID=fake-project
And forward the ports in composer
ports: - 8085:8085
However, it then returns the following warning. That it cannot bind to the port because the emulator is already in use...
ERROR: for docker_kubernetes_1 Cannot start service kubernetes: driver failed programming external connectivity on endpoint docker_kubernetes_1 (a375f802e40946c8e724bbba91e159b5fe1ae268ff316b01f909465330ee8a88): Error starting userland proxy: listen tcp 0.0.0.0:8085: bind: address already in use
ERROR: for kubernetes Cannot start service kubernetes: driver failed programming external connectivity on endpoint docker_kubernetes_1 (a375f802e40946c8e724bbba91e159b5fe1ae268ff316b01f909465330ee8a88): Error starting userland proxy: listen tcp 0.0.0.0:8085: bind: address already in use ERROR: Encountered errors while bringing up the project.
I am new to container networking. I have tried with localhost, dockerhost, setting network:host.
I am aware there are pubsub emulators docker images, but ideally I'd like to run it on my host machine as it gives me more flexibility with how I am using the emualtor.
Thanks!