Upgrade to Jupyter Notebook

* Change minimal-notebook to install notebook=4.0*
* Change other Dockerfile to point to 4.0 Docker Hub tag (to be built)
* Change config and pem file paths for jupyter
* Install ipywidgets in all containers that have a Python stack
* Update all READMEs to describe v3.2 and v4.0 since Docker Hub only shows one README for all tags

Contribution (c) Copyright IBM Corp. 2015
This commit is contained in:
Peter Parente
2015-08-22 22:23:24 -04:00
parent 4dbc42b5a9
commit e1c0c75c9c
11 changed files with 39 additions and 29 deletions

View File

@@ -0,0 +1,27 @@
# Copyright (c) Jupyter Development Team.
from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
PEM_FILE = os.path.join(jupyter_data_dir(), 'notebook.pem')
c = get_config()
c.NotebookApp.ip = os.getenv('INTERFACE', '') or '*'
c.NotebookApp.port = int(os.getenv('PORT', '') or 8888)
c.NotebookApp.open_browser = False
# Set a certificate if USE_HTTPS is set to any value
if 'USE_HTTPS' in os.environ:
if not os.path.isfile(PEM_FILE):
# Generate a certificate if one doesn't exist on disk
subprocess.check_call(['openssl', 'req', '-new',
'-newkey', 'rsa:2048', '-days', '365', '-nodes', '-x509',
'-subj', '/C=XX/ST=XX/L=XX/O=generated/CN=generated',
'-keyout', PEM_FILE, '-out', PEM_FILE])
c.NotebookApp.certfile = PEM_FILE
# Set a password if PASSWORD is set
if 'PASSWORD' in os.environ:
from IPython.lib import passwd
c.NotebookApp.password = passwd(os.environ['PASSWORD'])
del os.environ['PASSWORD']