-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
117 lines (100 loc) · 4.25 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
#FROM continuumio/anaconda3
FROM debian:latest
LABEL maintainer="Shmuel Maruani | LimitlessV | Limitless Virtue LLC"
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ENV PATH /opt/conda/bin:$PATH
# install
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \
libglib2.0-0 libxext6 libsm6 libxrender1 \
git mercurial subversion
#
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
software-properties-common \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
libfreetype6-dev \
libicu-dev \
libssl-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libedit-dev \
libedit2 \
libxslt1-dev \
apt-utils \
gnupg \
redis-tools \
mysql-client \
git \
vim \
nano \
wget \
curl \
lynx \
psmisc \
unzip \
tar \
bzip2 \
cron \
grep \
sed \
dpkg \
bash-completion \
&& apt-get clean
RUN wget --quiet https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc
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
# Use a fixed apt-get repo to stop intermittent failures due to flaky httpredir connections,
# as described by Lionel Chan at http://stackoverflow.com/a/37426929/5881346
RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list && \
apt-get update && apt-get install -y build-essential && \
# https://stackoverflow.com/a/46498173
conda update -y conda && conda update -y python && \
pip install --upgrade pip && \
apt-get -y install cmake
RUN pip install seaborn python-dateutil dask pytagcloud pyyaml joblib \
husl geopy ml_metrics mne pyshp gensim && \
conda install -y -c conda-forge spacy && python -m spacy download en && \
python -m spacy download en_core_web_lg && \
# The apt-get version of imagemagick is out of date and has compatibility issues, so we build from source
apt-get -y install dbus fontconfig fontconfig-config fonts-dejavu-core fonts-droid ghostscript gsfonts hicolor-icon-theme \
libavahi-client3 libavahi-common-data libavahi-common3 libcairo2 libcap-ng0 libcroco3 \
libcups2 libcupsfilters1 libcupsimage2 libdatrie1 libdbus-1-3 libdjvulibre-text libdjvulibre21 libfftw3-double3 libfontconfig1 \
libfreetype6 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common libgomp1 libgraphite2-3 libgs9 libgs9-common libharfbuzz0b libijs-0.35 \
libilmbase6 libjasper1 libjbig0 libjbig2dec0 libjpeg62-turbo liblcms2-2 liblqr-1-0 libltdl7 libmagickcore-6.q16-2 \
libmagickcore-6.q16-2-extra libmagickwand-6.q16-2 libnetpbm10 libopenexr6 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 \
libpaper-utils libpaper1 libpixman-1-0 libpng12-0 librsvg2-2 librsvg2-common libthai-data libthai0 libtiff5 libwmf0.2-7 \
libxcb-render0 libxcb-shm0 netpbm poppler-data p7zip-full && \
cd /usr/local/src && \
wget http://transloadit.imagemagick.org/download/ImageMagick.tar.gz && \
tar xzf ImageMagick.tar.gz && cd `ls -d ImageMagick-*` && pwd && ls -al && ./configure && \
make -j $(nproc) && make install && \
# clean up ImageMagick source files
cd ../ && rm -rf ImageMagick*
RUN pip install seaborn python-dateutil dask pytagcloud pyyaml joblib \
husl geopy ml_metrics mne pyshp gensim
# 'spacy' is a package and cannot be directly executed
RUN conda remove -y spacy
RUN conda install -y -c anaconda setuptools
RUN pip install spacy
# jupyter notebook
RUN echo "/opt/conda/bin/jupyter notebook --notebook-dir=/work --ip='*' --port=8888 --no-browser --allow-root" > ~/run_jupyter.sh
RUN chmod +x ~/run_jupyter.sh
#RUN ~/run_jupyter.sh
VOLUME /work
WORKDIR /work
# Define working directory.
#WORKDIR /data
# Define default command.
#CMD ["bash"]
ENTRYPOINT [ "/usr/bin/tini", "--" ]
CMD [ "/bin/bash" ]