-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ubuntu18.04
More file actions
110 lines (91 loc) · 3.79 KB
/
Dockerfile.ubuntu18.04
File metadata and controls
110 lines (91 loc) · 3.79 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
# Universal image for running Notebook, Dask pipelines, libs, and lint checkers
ARG PYTHON=python3
FROM ubuntu:18.04
ARG PYTHON
MAINTAINER Piers Harding "piers@catalyst.net.nz"
ENV LANG en_NZ.UTF-8
ENV LANGUAGE en_NZ.UTF-8
ENV LC_ALL en_NZ.UTF-8
ENV HOME /root
ENV DEBIAN_FRONTEND noninteractive
# the package basics for Python 3
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update -y && \
apt-get install -y locales tzdata python-pip net-tools vim-tiny software-properties-common \
python3-software-properties build-essential curl wget fonts-liberation ca-certificates libcfitsio-dev && \
echo "Setting locales ..." && /usr/sbin/locale-gen en_US.UTF-8 && \
/usr/sbin/locale-gen en_NZ.UTF-8 && \
echo "Setting timezone ..." && /bin/echo 'Pacific/Auckland' | tee /etc/timezone && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --frontend noninteractive tzdata && \
add-apt-repository -y ppa:git-core/ppa && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get install -y git-lfs && \
git lfs install && \
apt-get install -y ${PYTHON}-dev python3-tk flake8 python3-nose \
virtualenv virtualenvwrapper && \
apt-get install -y graphviz && \
apt-get install -y nodejs npm && \
apt-get clean -y
# node node is linked to nodejs
RUN if [ ! -f /usr/bin/node ]; then ln -s /usr/bin/nodejs /usr/bin/node ; fi && \
node --version
# sort out pip and python for 3.6
RUN cd /src; wget https://bootstrap.pypa.io/get-pip.py && ${PYTHON} get-pip.py; \
rm -rf /root/.cache
# Install Tini
RUN 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
# Add and install Python modules
ADD ./requirements.txt /src/requirements.txt
RUN cd /src; pip3 install -r requirements.txt; rm -rf /root/.cache
RUN pip3 install bokeh && pip3 install pytest; pip3 install jupyter_nbextensions_configurator; pip3 install jupyter_contrib_nbextensions; rm -rf /root/.cache
RUN pip3 install -U pylint; rm -rf /root/.cache
RUN jupyter contrib nbextension install --system --symlink
RUN jupyter nbextensions_configurator enable --system
#RUN pip install jupyterlab
#RUN jupyter serverextension enable --py jupyterlab --sys-prefix
#RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager
#RUN jupyter labextension install jupyterlab_bokeh
# 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/
# run setup
RUN \
cd /arl && \
${PYTHON} setup.py build && \
${PYTHON} setup.py install && \
cd /arl/workflows/ffiwrapped/serial && \
make
# 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 ["tini", "--"]
# Run - default is notebook
CMD ["/boot.sh"]