-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.alpine3.8
More file actions
134 lines (115 loc) · 4.47 KB
/
Copy pathDockerfile.alpine3.8
File metadata and controls
134 lines (115 loc) · 4.47 KB
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
# Universal image for running Notebook, Dask pipelines, libs, and lint checkers
ARG PYTHON=python3
FROM alpine:3.8
ARG PYTHON
MAINTAINER Piers Harding "piers@catalyst.net.nz"
ENV HOME /root
ENV PYTHON_PIP_VERSION 10.0.1
# runtime specific environment
ENV JENKINS_URL 1
ENV PYTHONPATH /arl
ENV JUPYTER_PATH /arl/examples/arl
RUN touch "${HOME}/.bash_profile"
# Bundle app source
ADD ./docker/boot.sh /
ADD ./Makefile /arl/
ADD ./setup.py ./README.md /arl/
ADD ./data_models /arl/data_models/
ADD ./examples /arl/examples/
ADD ./ffiwrappers /arl/ffiwrappers/
ADD ./k8s /arl/k8s/
ADD ./libs /arl/libs/
ADD ./processing_components /arl/processing_components/
ADD ./scripts /arl/scripts/
ADD ./tests /arl/tests/
ADD ./util /arl/util/
ADD ./workflows /arl/workflows/
# Add and install Python modules
ADD ./requirements.txt /src/requirements.txt
# the package basics for Python 3
RUN apk add --update --no-cache ${PYTHON} py3-pip \
openssl ca-certificates
# openblas-dev
RUN \
apk add --update --no-cache --virtual build-dependencies \
wget bash make tini \
git curl net-tools vim \
py3-virtualenv \
py3-nose nodejs nodejs-npm \
graphviz freetype libpng \
python3-tkinter \
py3-lxml py3-numpy py3-numpy-f2py py-numpy-dev \
libgomp lapack && \
apk add --update --no-cache --virtual .build-deps \
build-base python3-dev freetype-dev libpng-dev \
gcc gfortran musl-dev g++ bzip2-dev coreutils \
dpkg-dev dpkg expat-dev gdbm-dev libc-dev \
libnsl-dev openssl-dev libtirpc-dev \
linux-headers ncurses-dev pax-utils \
readline-dev sqlite-dev tcl-dev tk tk-dev \
xz-dev zlib-dev libxml2-dev libxslt-dev \
libffi-dev lapack-dev jpeg-dev && \
apk add --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing --update hdf5-dev && \
wget -qO- https://github.com/git-lfs/git-lfs/releases/download/v2.4.2/git-lfs-linux-amd64-2.4.2.tar.gz | tar xz && \
mv git-lfs-*/git-lfs /usr/bin/ && rm -rf git-lfs-* && \
git lfs install && \
ln -s /usr/include/locale.h /usr/include/xlocale.h && \
if [ ! -f /usr/bin/node ]; then ln -s /usr/bin/nodejs /usr/bin/node ; fi && \
node --version && \
wget --quiet https://github.com/krallin/tini/releases/download/v0.18.0/tini && \
echo "12d20136605531b09a2c2dac02ccee85e1b874eb322ef6baf7561cd93f93c855 *tini" | sha256sum -c - && \
mv tini /usr/local/bin/tini && \
chmod +x /usr/local/bin/tini && \
cd /src && wget https://bootstrap.pypa.io/get-pip.py && \
python3 get-pip.py --disable-pip-version-check \
--no-cache-dir "pip==$PYTHON_PIP_VERSION" && \
rm -f get-pip.py && \
pip3 install bokeh && \
pip3 install pytest && \
pip3 install flake8 && \
pip3 install Cython && \
cd /src && pip3 install -r requirements.txt && \
pip3 install jupyter_nbextensions_configurator && \
pip3 install jupyter_contrib_nbextensions && \
pip3 install -U pylint && \
rm -rf /root/.cache && \
jupyter contrib nbextension install --system --symlink && \
jupyter nbextensions_configurator enable --system && \
cd /src && \
wget -qO- http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio_latest.tar.gz | tar xz && \
cd /src/cfitsio && \
./configure --prefix=/usr && \
make && make install && \
rm -rf /src/cfitsio && \
cd /arl && \
${PYTHON} setup.py build && \
${PYTHON} setup.py install && \
cp /arl/build/lib*/*arlffi* /arl/ && \
cd /arl/workflows/ffiwrapped/serial && \
make && \
apk del .build-deps && \
rm -rf /var/cache/apk/*
# python must exist
RUN \
if [ ! -f /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python ; fi
# additional optional extensions
#RUN pip3 install jupyterlab
#RUN jupyter serverextension enable --py jupyterlab --sys-prefix
#RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager
#RUN jupyter labextension install jupyterlab_bokeh
# create space for libs
RUN mkdir -p /arl/test_data /arl/test_results && \
chmod 777 /arl /arl/test_data /arl/test_results && \
chmod -R a+w /arl
COPY --chown="1000:100" ./docker/jupyter_notebook_config.py "${HOME}/.jupyter/"
COPY ./docker/notebook.sh /usr/local/bin/
COPY ./docker/start-dask-scheduler.sh /usr/local/bin/
COPY ./docker/start-dask-worker.sh /usr/local/bin
# We share in the arl data here
VOLUME ["/arl/data", "/arl/tmp"]
# Expose Jupyter and Bokeh ports
EXPOSE 8888 8786 8787 8788 8789
# Setup the entrypoint or environment
ENTRYPOINT ["/sbin/tini", "--"]
# Run - default is notebook
CMD ["/boot.sh"]