IJulia notebook() in Docker container

Hello,

for testing purposes I am using a Docker container to run some Julia notebooks. With the project at hand I have no problems to start the Jupyter notebook by using

using IJulia
notebook()

This is not a problem either if running in a Virtual Machine, but when using a Docker container, the notebook function doesn’t let me specify the IP where jupyter should be listening, so I cannot open the Jupyter notebook from outside the container.

If I start Jupyter from outside Julia, but using the Conda distribution installed from within Julia (using package Conda.jl), then I have no problem starting the jupyter server and opening the notebooks from outside the container, by doing:

$ lib/loc-miniconda/bin/jupyter-notebook --ip=0.0.0.0 --no-browser

But in my setting, the --ip part is of essence to get it working. Do you know of a workaround? (in any case, it would be nice if the notebook function would allow as arguments some of the most common options to jupyter-notebook)

Thanks,

Seems like a good feature request. For now you can put

c.NotebookApp.ip = '0.0.0.0'

in ~/.jupyter/jupyter_notebook_config.py or create a wrapper script (e.g. jupyter-ip) with something like

#!/bin/bash
exec jupyter --ip=0.0.0.0 "${@}"

and point the JUPYTER environment variable to this script and re-run Pkg.build("IJulia").

1 Like

That’s great. Adding jupyter_notebook_config.py and settings for the IP and a password (so I don’t have to bother about the token), I can now launch the notebook directly from Julia inside the Docker container and open it in the host browser.

Thanks a lot. (but in any case I submitted a feature request in IJulia github to add the IP argument to the notebook function, but for the moment this solves my problem).