How can I connect to the IB Gateway with ib_async running in a docker container? #177
Unanswered
dekaidekai
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello thanks for the awesome tool!
I am running my
ib_async
python code in a docker container and trying to connect it to my IB Gateway app, but I am having some trouble and feel like I'm missing something in the setup.Does anyone have any guidance on how to connect to the IB Gateway through
ib_async
code that is running in a docker container?I am facing this issue when trying to connect to the IB Gateway app which is directly running on my host machine (Mac OS) or even when it's in another docker container using ib-gateway and connecting through the docker network. To try to simplify my issue though, below I'll explain the issue only when running IB Gateway app on my host machine.
Any help would be much appreciated, thank you!
Issue
(see below for my minimal reproducible set up)
It seems that my from inside the docker container it can find the IB Gateway port 4002 open using
nc
command. The functionib_async.connect
will also connect successfully to the IB Gateway socket. However, if I'm not mistaken, after this I am thinking thatib_async
will hang and never receive any data from the socket and therefore not complete the API connection and timeout at the await asyncio.wait_for(self.apiStart, timeout) part.basic.py logs
However if I run the python code outside of the docker container and directly on my host machine, then the initial connection and API connection in
ib_async
quickly succeeds, and everything works as expected.Minimal reproducible set up
docker-compose.yml
Dockerfile for basic
entrypoint.sh
basic.py
IB Gateway settings
OFF
4002
OFF
Beta Was this translation helpful? Give feedback.
All reactions