forked from senzing-garage/docker-jupyter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
137 lines (99 loc) · 3.15 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
# User can select the base image.
# For BASE_IMAGE choices, see https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html
ARG BASE_IMAGE=jupyter/minimal-notebook
FROM ${BASE_IMAGE}
ENV REFRESHED_AT=2019-08-31
LABEL Name="senzing/jupyter" \
Maintainer="support@senzing.com" \
Version="1.1.0"
HEALTHCHECK CMD ["/app/healthcheck.sh"]
#############################################
## OS infrastructure
#############################################
USER root
# Update OS packages.
RUN apt-get update
RUN apt-get -y upgrade
RUN apt -y autoremove
# Install packages via apt.
RUN apt-get -y install \
curl \
gnupg \
jq \
lsb-core \
lsb-release \
odbc-postgresql \
postgresql-client \
python-dev \
python-pip \
python-pyodbc \
sqlite \
unixodbc \
unixodbc-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
#############################################
## Python infrastructure
#############################################
# Update Anaconda.
RUN conda update -y -n base conda
# Python 2.
RUN conda create -n ipykernel_py2 python=2 ipykernel
# Python libraries for python 2.7.
RUN conda install -n ipykernel_py2 -y \
bokeh \
ipykernel \
ipython \
networkx \
numpy \
pandas \
plotly \
psutil \
pyodbc \
qgrid \
seaborn \
sympy \
version_information
# Install notebook widgets.
RUN conda install -n ipykernel_py2 -c conda-forge -y \
widgetsnbextension \
ipywidgets
# Install jupyter widgets for qgrid.
RUN conda run -n ipykernel_py2 jupyter labextension install @jupyter-widgets/jupyterlab-manager
# Enable qgrid inside jupyter notebooks.
RUN conda run -n ipykernel_py2 jupyter labextension install qgrid
# Install python 2.7 kernel for users.
RUN conda run -n ipykernel_py2 python -m ipykernel install --user
# Install nbextensions
RUN pip3 install \
jupyter_contrib_nbextensions \
https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tarball/master
RUN jupyter contrib nbextension install --user
RUN pip3 install jupyter_nbextensions_configurator
RUN jupyter nbextensions_configurator enable --user
# Update nodeJS.
RUN npm i -g npm
#############################################
## Prepare user home dir
#############################################
# Copy files from repository.
COPY ./rootfs /
COPY ./notebooks /notebooks
VOLUME /notebooks/shared
# Adjust permissions
RUN chown -R $NB_UID:$NB_GID /notebooks
RUN chmod -R ug+rw /notebooks
RUN chown -R $NB_UID:$NB_GID /home/$NB_USER
RUN chmod -R ug+rw /home/$NB_USER
#############################################
## User environment setting
#############################################
# Return to original user.
# Defined in https://github.com/jupyter/docker-stacks/blob/master/base-notebook/Dockerfile
USER $NB_UID
ENV SENZING_ROOT=/opt/senzing
ENV PYTHONPATH=${SENZING_ROOT}/g2/python
ENV LD_LIBRARY_PATH=${SENZING_ROOT}/g2/lib:${SENZING_ROOT}/g2/lib/debian
ENV DB2_CLI_DRIVER_INSTALL_PATH=${SENZING_ROOT}/db2/clidriver
ENV PATH=$PATH:${SENZING_ROOT}/db2/clidriver/adm:${SENZING_ROOT}/db2/clidriver/bin
WORKDIR /notebooks