-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
209 lines (170 loc) · 6.18 KB
/
Dockerfile
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# machine learning gears
#FROM gcr.io/tensorflow/tensorflow:latest-devel-gpu
FROM gcr.io/tensorflow/tensorflow:latest-gpu
MAINTAINER Marsan Ma <[email protected]>
#---------------------------------
# basic tools
#---------------------------------
RUN apt-get update
RUN apt-get install -y wget htop vim unzip procps
#---------------------------------
# kaggle/python layers
#---------------------------------
# Anaconda3 (https://hub.docker.com/r/continuumio/anaconda3/~/dockerfile/)
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
git mercurial subversion
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/archive/Anaconda3-4.1.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh
RUN apt-get install -y curl grep sed dpkg && \
TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
dpkg -i tini.deb && \
rm tini.deb && \
apt-get clean
ENV PATH /opt/conda/bin:$PATH
# kaggle/python0 (https://hub.docker.com/r/kaggle/python0/~/dockerfile/)
RUN apt-get install -y build-essential python-software-properties
# kaggle/python1 (https://hub.docker.com/r/kaggle/python1/~/dockerfile/)
RUN pip install seaborn python-dateutil spacy dask pytagcloud pyyaml ggplot joblib \
husl geopy ml_metrics mne pyshp gensim && \
apt-get install -y libfreetype6-dev && \
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
# textblob
pip install textblob && \
#word cloud
pip install git+git://github.com/amueller/word_cloud.git
# kaggle/python2 (https://hub.docker.com/r/kaggle/python2/~/dockerfile/)
RUN apt-get install -y libfreetype6-dev && \
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
# textblob
# pip install python-igraph && \
#xgboost
cd /usr/local/src && mkdir xgboost && cd xgboost && \
git clone --recursive https://github.com/dmlc/xgboost.git && cd xgboost && \
make && cd python-package && python setup.py install
# kaggle/python3 (https://hub.docker.com/r/kaggle/python3/~/dockerfile/)
RUN apt-get -y install zlib1g-dev liblcms2-dev libwebp-dev && \
pip install Pillow
# kaggle/python (https://hub.docker.com/r/kaggle/python/~/dockerfile/)
#RUN cd /usr/local/src && git clone https://github.com/scikit-learn/scikit-learn.git && \
# cd scikit-learn && python setup.py build && python setup.py install && \
RUN conda install scikit-learn
# HDF5 support
RUN conda install h5py
RUN pip install --upgrade mpld3 && \
pip install mplleaflet && \
pip install gpxpy && \
pip install arrow && \
pip install sexmachine && \
pip install Geohash && \
pip install deap && \
pip install tpot && \
pip install haversine && \
pip install toolz cytoolz && \
pip install sacred && \
pip install plotly && \
pip install git+https://github.com/nicta/dora.git && \
pip install git+https://github.com/hyperopt/hyperopt.git && \
# tflean. Deep learning library featuring a higher-level API for TensorFlow. http://tflearn.org
#pip install git+https://github.com/tflearn/tflearn.git && \
pip install fitter && \
pip install langid && \
# Delorean. Useful for dealing with datetime
pip install delorean
#---------------------------------
# Marsan's toolbelt
#---------------------------------
RUN conda install mkl
RUN conda install libgfortran
RUN pip install \
pandas \
mongoengine \
bottle \
cherrypy \
jieba3k \
yolk3k \
azure
RUN pip install \
cython \
html5lib
RUN pip install \
pyyaml \
demjson \
hanziconv \
tweepy
RUN pip install \
ftfy \
hiredis \
google-api-python-client \
regex
RUN pip install \
Django \
django-pipeline \
django-bootstrap3 \
django_compressor \
rest-pandas \
gunicorn \
boto3 \
PyMySQL
RUN pip install \
djangoajax \
django-dashing
## MySQL
#RUN apt-get install -y python3-dev libmysqlclient-dev
#RUN pip install mysqlclient
# pathos (python parallel process)
#RUN pip install -U git+https://github.com/uqfoundation/pathos.git@master
#RUN pip install -U \
# newspaper3k
# Tensorflow GPU supported version
RUN pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-linux_x86_64.whl
#---------------------------------
# For OpenAI Gym
#---------------------------------
RUN apt-get install -y \
python-opengl \
xorg-dev \
libglu1-mesa libgl1-mesa-dev \
xvfb \
libxinerama1 libxcursor1
#---------------------------------
# Supervisord
#---------------------------------
# Install Supervisor.
RUN \
apt-get update && \
apt-get install -y supervisor && \
rm -rf /var/lib/apt/lists/* && \
sed -i 's/^\(\[supervisord\]\)$/\1\nnodaemon=true/' /etc/supervisor/supervisord.conf
# Define mountable directories.
VOLUME ["/etc/supervisor/conf.d"]
# ------------------------------------------------------------------------------
# Security changes
# - Determine runlevel and services at startup [BOOT-5180]
RUN update-rc.d supervisor defaults
# - Check the output of apt-cache policy manually to determine why output is empty [KRNL-5788]
RUN apt-get update | apt-get upgrade -y
# - Install a PAM module for password strength testing like pam_cracklib or pam_passwdqc [AUTH-9262]
RUN apt-get install libpam-cracklib -y
RUN ln -s /lib/x86_64-linux-gnu/security/pam_cracklib.so /lib/security
#---------------------------------
# Enviroment
#---------------------------------
# Timezone
RUN echo "Asia/Taipei" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
# conventions
COPY files/bashrc /root/.bashrc
COPY files/vimrc /root/.vimrc
# setup supervisor apps & start supervisor
COPY files/supervisor/* /etc/supervisor/conf.d/
CMD ["supervisord", "-c", "/etc/supervisor/supervisord.conf"]
## Set the working directory
WORKDIR /home/workspace
EXPOSE 8880:8900
EXPOSE 80
EXPOSE 443