forked from QuantConnect/Lean
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileLeanFoundation
71 lines (60 loc) · 3.02 KB
/
DockerfileLeanFoundation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# LEAN Foundation Docker Container 20170623
# 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 Python.NET and IB inside a headless container.
RUN \
apt-get update && \
apt-get install -y wget xvfb unzip curl libxrender1 libxtst6 libxi6 python-pip && \
pip install --upgrade pip && pip install pycparser pandas scipy numpy sklearn && \
pip install blaze cvxopt cvxpy pykalman statistics statsmodels arch copulalib && \
pip install xgboost theano keras tensorflow
# 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 777 ibgateway-latest-standalone-linux-x64-v960.2a.sh && \
./ibgateway-latest-standalone-linux-x64-v960.2a.sh -q && \
wget -O ~/Jts/jts.ini http://data.quantconnect.com/interactive/ibgateway-latest-standalone-linux-x64-v960.2a.jts.ini && \
rm ibgateway-latest-standalone-linux-x64-v960.2a.sh
# Install IB Controller: Installs to ~/IBController
RUN \
wget http://data.quantconnect.com/interactive/IBController-QuantConnect-3.2.0.zip && \
unzip IBController-QuantConnect-3.2.0.zip -d ~/IBController && \
chmod -R 777 ~/IBController && \
rm IBController-QuantConnect-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 mono-vbnc nuget referenceassemblies-pcl \
&& apt-get install -y fsharp && rm -rf /var/lib/apt/lists/* /tmp/*
# Install Python.NET
RUN nuget install QuantConnect.pythonnet -Version 1.0.4.4 \
&& cp QuantConnect.pythonnet.1.0.4.4/lib/Python.Runtime.dll /usr/lib
RUN ln -s /usr/lib/x86_64-linux-gnu/libpython2.7.so /usr/lib/libpython27.so
# Install TA-lib for python
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \
&& tar -zxvf ta-lib-0.4.0-src.tar.gz \
&& cd ta-lib \
&& ./configure --prefix=/usr \
&& make \
&& make install \
&& pip install TA-lib