Git Product home page Git Product logo

ib-gateway-docker's Introduction

Interactive Brokers Gateway Docker

Runs the Interactive Brokers Gateway in a docker container.

The image contains the following components.

  • IB Gateway Application
  • IBC Application - enables automated launch of the IB Gateway Application.
  • Xvfb - a X11 virtual framebuffer to run IB Gateway Application without graphics hardware.
  • x11vnc - a VNC server that allows to interact with the IB Gateway user interface

Usage

The simplest way to use the container is with the prebuilt image.

Given that Interactive Broker credentials are defined in a file named credentials.env. The gateway can be launched using the following commands.

The following command will launch the gateway in live mode.

docker run --env-file credentials.env -p 5900:5900 -p 4001:4001 wboayue/ib-gateway:latest

The following command will launch the gateway in paper mode.

docker run --env-file credentials.env -e TRADING_MODE=paper -p 5900:5900 -p 4002:4002 wboayue/ib-gateway:latest

When the container successfully launches the interactive broker gateway runs on port 4001 for live mode and port 4002 for paper mode. The VNC server runs on port 5900. It is assumed that the container runs on a secure network.The VNC server does not require a password.

Credentials are specified in credentials.env using the following format.

IB_LOGIN=<ib login>
IB_PASSWORD=<ib password>

The image with the tag latest is built with Interactive Brokers Gateway version 10.20 and IBC version 3.16.0.

Development

Build container

docker build -t ib-gateway:latest .

Run Gateway

docker run --env-file ib-paper.env -p 5900:5900 -p 4002:4002 ib-gateway
docker run --env-file ib-live.env -p 5900:5900 -p 4001:4001 ib-gateway

Configuration

IB_LOGIN=<ib login>
IB_PASSWORD=<ib password>
TRADING_MODE=[live|paper]

Exposed Services

The container runs the following services.

Service Port Description
VNC Viewer 5900 Enables viewing of desktop with VNC client.
IB Gateway 4001 IB Gateway when launched in paper mode.
IB Gateway 4002 IB Gateway when launched in live mode.

Publish Container

Follow these steps to publish the container to Docker Hub.

docker login

docker build -t ib-gateway:latest .

docker tag ib-gateway:latest [username]/ib-gateway:latest
docker tag ib-gateway:latest [username]/ib-gateway:[gateway version]

docker push [username]/ib-gateway:latest
docker push [username]/ib-gateway:[gateway version]

ib-gateway-docker's People

Contributors

wboayue avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.