-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathdb2jupyter.docker
53 lines (42 loc) · 1.66 KB
/
db2jupyter.docker
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
#
# Jupyter notebooks for Db2 using Python 3.x format
# Version 1.5
# 2019-04-28
# Author: George Baklarz
#
# Build image:
# docker build -t db2jupyter -f db2jupyter.docker .
# Run image:
# docker run --name db2jupyter -d -p 8888:8888 db2jupyter
FROM continuumio/anaconda3
# 1. Update the distribution
# 2. Install Pixiedust library
# 3. Update apt-get and install the gcc compiler
# 4. easy_install the Db2 drivers (ibm-db)
# 5. Remove temp files
RUN conda update -y conda && \
conda install -y -c conda-forge ipywidgets qgrid && \
pip install pixiedust && \
apt-get update && \
apt-get install -y gcc && \
easy_install ibm-db && \
rm -rf /var/lib/apt/lists/*
# Create the directory for Jupyter defaults and insert the settings into the file
# 1. Allow connection without a password
# 2. True deletion of files (bypasses a bug in Jupyter)
# 3. Allow root to run Jupyter
# 4. Clone the Db2-Samples Jupyter notebooks files into the /opt/notebooks directory
RUN mkdir /root/.jupyter && \
echo "c.NotebookApp.token = u''" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.FileContentsManager.delete_to_trash=False" >> ~/.jupyter/jupyter_notebook_config.py && \
echo "c.NotebookApp.allow_root=True" >> ~/.jupyter/jupyter_notebook_config.py && \
git clone git://github.com/DB2-Samples/db2jupyter.git /opt/notebooks
#
# Command to start Jupyter in the container
# Updated --ip='*' to --ip='0.0.0.0'
#
CMD jupyter notebook --NotebookApp.token= --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser --allow-root
ENV DESCRIPTION="Db2 Jupyter Notebook" \
VERSION="1.4" \
BUILD_DATE="2018-07-17"
EXPOSE 8888