forked from Kaggle/docker-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (36 loc) · 2.61 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
FROM kaggle/python1:latest
# set backend for matplotlib to Agg
RUN matplotlibrc_path=$(python -c "import site, os, fileinput; packages_dir = site.getsitepackages()[0]; print(os.path.join(packages_dir, 'matplotlib', 'mpl-data', 'matplotlibrc'))") && \
sed -i 's/^backend : Qt4Agg/backend : Agg/' $matplotlibrc_path
# Stop ipython nbconvert trying to rewrite its folder hierarchy
RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py && touch /root/.jupyter/migrated && \
mkdir -p /.jupyter && touch /.jupyter/jupyter_nbconvert_config.py && touch /.jupyter/migrated && \
# Keras likes to add a config file in a custom directory when it's
# first imported. This doesn't work with our read-only filesystem, so we
# have it done now
python -c "from keras.models import Sequential" && \
# Stop Matplotlib printing junk to the console on first load
sed -i "s/^.*Matplotlib is building the font cache using fc-list.*$/# Warning removed by Kaggle/g" /opt/conda/lib/python3.4/site-packages/matplotlib/font_manager.py
# h2o
# (This requires python-software-properties; see the MXNet section above for installation.)
# Java7 install method from http:https://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
# and https://stackoverflow.com/a/19391042
RUN apt-get install -y wget unzip && \
echo "deb http:https://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
echo "deb-src http:https://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list && \
apt-key adv --keyserver hkp:https://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
apt-get update && \
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections && \
apt-get install -y oracle-java7-installer && \
# NOTE: h2o's "latest_stable" file has gone stale with the 3.6.0.8 release--revert to these
# lines when it's fixed
# cd /usr/local/src && mkdir h2o && cd h2o && \
# wget http:https://h2o-release.s3.amazonaws.com/h2o/latest_stable -O latest && \
# wget --no-check-certificate -i latest -O h2o.zip && rm latest && \
# unzip h2o.zip && rm h2o.zip && cp h2o-*/h2o.jar . && \
# pip install `find . -name "*whl"`
pip install http:https://h2o-release.s3.amazonaws.com/h2o/rel-tibshirani/8/Python/h2o-3.6.0.8-py2.py3-none-any.whl
# TensorFlow
RUN pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp34-none-linux_x86_64.whl
RUN pip install --upgrade mpld3