I am trying to setup the InteractiveBrokers Client Portal API Gateway to run inside a Docker container, where I will only access it from the local host. I want the solution to be independent of OS, primarily Windows or Linux.
I am able to configure a Docker container such that the gateway runs, but when I try to access it, I get Access Denied
. I believe this is from the actual gateway, so I am at least connecting to it.
Here is my Dockerfile
:
FROM ubuntuWORKDIR /homeRUN apt-get updateRUN apt-get upgrade -yRUN apt-get install default-jre wget unzip -yRUN wget https://download2.interactivebrokers.com/portal/clientportal.gw.zipRUN unzip clientportal.gw.zip -d ./clientportal.gwWORKDIR /home/clientportal.gwCMD ./bin/run.sh ./root/conf.yaml
I build and run the Docker image and container, respectively, with:
docker build -t clientportal ./docker run -p 5000:5000 -it clientportal
I have also modified the conf.yaml
to allow various IP ranges:
ips: allow: - 192.* - 131.216.* - 127.0.0.1 - host.docker.internal - 172.17.0.* deny: - 212.90.324.10
It's my understanding that host.docker.internal
is the hostname of the host from the perspective of the Docker container, and that Docker container's localhost
's resolve to 172.17.0.*
. These are the two additional ranges I added to the default list. It is also my understanding this IP is a whitelist of IP addresses that can connect to the gateway. I'm not sure what IP address range I am missing for the host when trying to connect to the gateway running inside the Docker container. If I run the gateway directly in Windows, then I can connect and authenticate.
What IP should I waitlist in conf.yaml
to make this work? What other settings do I need? Besides the above, I have also inspected the conf.yaml
in the IBeam repository and don't see any major differences. I have also tried the IP ranges there to no avail.