Skip to content

Commit

Permalink
Updated dockerfiles to include headless linux support for IB
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredbroad committed Nov 13, 2016
1 parent dc09a02 commit 7453ad2
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*/packages/*
*/.git/*
*/.vs/*
*/.nuget/*
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

38 changes: 38 additions & 0 deletions DockerfileLeanAlgorithm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# LEAN Algorithm Docker Container November-2016
# Cross platform deployment for multiple brokerages
#

FROM quantconnect/lean:foundation

MAINTAINER QuantConnect <contact@quantconnect.com>

#################################
# Option 1: Download from Master
# RUN \
# wget https://github.com/QuantConnect/Lean/archive/master.zip && \
# unzip master.zip ~/Lean && \
# cd ~/Lean
# RUN \
# sed -i 's/4.5/4.0/' Algorithm.VisualBasic/QuantConnect.Algorithm.VisualBasic.vbproj && \
# wget https://nuget.org/nuget.exe && \
# mono nuget.exe restore QuantConnect.Lean.sln -NonInteractive && \
# xbuild /property:Configuration=Release && \
# cd ~/Lean/Launcher/bin/Release/
#################################


################################
# Option 2: Run Local Binaries:
COPY ./Data ~/Lean/Data
COPY ./Launcher/bin/Release ~/Lean/Launcher/bin/Release
#################################

# Finally.
WORKDIR ~/Lean/Launcher/bin/Release
CMD [ "mono", "QuantConnect.Lean.Launcher.exe"] # Run app

# Usage:
# docker build -t lean:foundation -f DockerfileLeanFoundation .
# docker build -t lean:algorithm -f DockerfileLeanAlgorithm .
# docker run lean:algorithm
52 changes: 52 additions & 0 deletions DockerfileLeanFoundation
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#
# LEAN Foundation Docker Container November-2016
# Cross platform deployment for multiple brokerages
# Intended to be used in conjunction with DockerfileLeanAlgorithm. This is just the foundation common OS+Dependencies required.
#

# Use base system for cleaning up wayward processes
FROM phusion/baseimage:0.9.19

MAINTAINER QuantConnect <contact@quantconnect.com>

# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]

# Install OS Packages:
# Misc tools for running IB inside a headless container.
RUN \
apt-get update && \
apt-get install -y dos2unix wget xvfb unzip curl libxrender1 libxtst6 libxi6

# Java for running IB inside container:
# https://github.com/dockerfile/java/blob/master/oracle-java8/Dockerfile
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer

# Install IB Gateway: Installs to ~/Jts
RUN \
wget http://data.quantconnect.com/interactive/ibgateway-latest-standalone-linux-x64-v960.2a.sh && \
chmod +x ibgateway-latest-standalone-linux-x64-v960.2a.sh && \
./ibgateway-latest-standalone-linux-x64-v960.2a.sh -q && \
rm ibgateway-latest-standalone-linux-x64-v960.2a.sh

# Install IB Controller: Installs to ~/IBController
RUN \
wget https://github.com/ib-controller/ib-controller/releases/download/3.2.0/IBController-3.2.0.zip && \
unzip IBController-3.2.0.zip -d ~/IBController && \
chmod -R +x ~/IBController && \
rm IBController-3.2.0.zip

# Mono C# for LEAN:
# From https://github.com/mono/docker/blob/master/4.6.1.5/
RUN apt-get update && rm -rf /var/lib/apt/lists/*
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.6.1.5 main" > /etc/apt/sources.list.d/mono-xamarin.list \
&& apt-get update \
&& apt-get install -y binutils mono-complete ca-certificates-mono fsharp mono-vbnc nuget referenceassemblies-pcl \
&& rm -rf /var/lib/apt/lists/* /tmp/*

0 comments on commit 7453ad2

Please sign in to comment.