A Debian-based Jupyter Python workstation. Provides Python, iPython and Jupyter Notebook.
1.0K
A Debian-based personal Jupyter Python workstation. Provides Python + basic engineering modules, iPython and Jupyter Notebook.
Ramon Solano <[email protected]>
Last update: May/22/2019
Debian version: 9.9
User/pwd:
Dockerfile$ docker build -t rsolano/python-notebook .
$ docker run [-it] [--rm] [--detach] [-h HOSTNAME] [-p LNOTEBOOKPORT:8888] [-v LDIR:DIR] rsolano/python-notebook [cmd]
where:
LNOTEBOOKPORT: Local HTTP Jupyter Notebook port to connecto to (e.g. 8888). Requires IP=0.0.0.0 when running Jupyter in your container for connecting from your locahost, otherwise IP=127.0.0.1 for internal access only.
LDIR:DIR: Local directory to mount on container. LDIR is the local directory to export; DIR is the target dir on the container. Both sholud be specified as absolute paths. For example: -v $HOME/worskpace:/home/debian/workspace.
cmd: User command to run inside the container
Run image, keep terminal open (interactive terminal session); remove container from memory once exited from container; map Jupyter Notebooks to 8888; mount local $HOME/workspace on container's /home/debian/workspace:
$ docker run -it --rm -p 8888:8888 -v $HOME/workspace:/home/debian/workspace rsolano/python-notebook
As above, but running immediately Jupyter:
$ docker run -it --rm -p 8888:8888 -v $HOME/workspace:/home/debian/workspace rsolano/python-notebook jupyter-notebook --ip 0.0.0.0 --no-browser
Run image, detach to background and keep running in memory (control returns to user immediately, Notebook keep running in background); map Jupyter Notebook to 8888; mount local $HOME/workspace on container's /home/debian/workspace:
$ docker run --detach -p 8888:8888 -v $HOME/workspace:/home/debian/workspace rsolano/python-notebook jupyter-notebook --ip 0.0.0.0 --no-browser
NOTES
There is no graphical desktop; just the Jupyter Notebook engine to serve Notebooks
Mapping Jupyter container port 8888 to our host's port 8888, allows us to connect to our computer (localhost:8888), which is actually forwarding to the container.
To run Jupyter in a headless container (no graphical display), you shoukd specify:
--no-browser : Do not open a local web browser--ip 0.0.0.0 : Allow connecting to Jupyter server from external computersThis means, run jupyter as:
$ jupyter-notebook --ip 0.0.0.0 --no-browser
If running an Jupyter in an interactive session:
CTRL-C in the interactive terminal to quit Jupyter.CTRL-D or key in exit end finish the session.If running detached (background) session:
Look for the container Id with docker ps:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ac46f0cf41d1 rsolano/python-notebook "/usr/bin/supervisor…" 58 seconds ago Up 57 seconds 0.0.0.0:5900->5900/tcp, 0.0.0.0:2222->22/tcp wizardly_bohr
Stop the desired container Id (ac46f0cf41d1 in this case):
$ docker stop ac46f0cf41d1
Content type
Image
Digest
Size
422.2 MB
Last updated
over 7 years ago
docker pull rsolano/python-notebook