Docker Community Forums

Share and learn in the Docker community.

Running jupyter notebook --port 8888 --ip '0.0.0.0'

I am trying to run a Docker image that I believe is appropriate for me. i have a screen shot that I beleive shows what is going on.

Normally the output when I enter the command is more detailed.

When I enter the second command

jupyter notebook --port 8888 --ip ‘0.0.0.0’

I get two choices of link to cut and paste in my browser . I pick the bottom or the lowest one. I cannot even remember why now. It just works. However, when running the image that is shown in the attached screenshot it only gives me the first one, not a second link as it usually does.

This time there is no bottom link to select. The wording even implies that there should be two links.

What is wrong. I show the screenshot and i am using a Docker like I have many times before, but something is wrong in that it only shows one not two links.

What si wrong here?

Any help appreciated. Thanks in advance.

Respectfully,

ErnestTBass

By default, Jupyter Notebook only accepts connections from localhost (eg, from the same computer that its running on). By modifying the NotebookApp.allow_origin option from the default ’ ’ to ‘*’, you allow Jupyter to be accessed externally.

c.NotebookApp.allow_origin = ‘*’ #allow all origins

You’ll also need to change the IPs that the notebook will listen on:

c.NotebookApp.ip = ‘0.0.0.0’ # listen on all IPs

I do not understand how to change it. As I said on most images I get two choices to link to and I select the lower one. Why I do, I have forgotten. But when run this particular image using the same commands it only gives me the top choice. That is all.

Please be more detailed on how to modify this situation.

Thanks in advance.

When I invoke that image from a single command like this:

docker run --rm -p 8787:8787 -v $(PWD):/opt/notebooks zhaotinghai/python /bin/bash -c "jupyter notebook --ip=0.0.0.0 --port=8787 --notebook-dir=/opt/notebooks --allow-root --no-browser"

I also see the following:

    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-1-open.html
    Or copy and paste one of these URLs:
        http://(a1ef1ca8c2b5 or 127.0.0.1):8787/?token=7324a777e18b8d29326ab0cc685c1d5ab17106b4640886cf

but I can sill access it with:

http://127.0.0.1:8787/?token=7324a777e18b8d29326ab0cc685c1d5ab17106b4640886cf

without any problems.

If I use the continuumio/anaconda3 image I see this:

    To access the notebook, open this file in a browser:
        file:///root/.local/share/jupyter/runtime/nbserver-1-open.html
    Or copy and paste one of these URLs:
        http://15eeac31f0ee:8888/?token=13073f1eafa249ce97bc2d4db78ff5c6ac95076301513ffd
     or http://127.0.0.1:8888/?token=13073f1eafa249ce97bc2d4db78ff5c6ac95076301513ffd

The zhaotinghai/python image is using an older version of Jupyter 4.4.0 which is behaving differently than the continuumio/anaconda3 image which has Jupyter core 4.6.3. You aren’t doing anything wrong. That’s just the way they work. I’m guessing your local Jupyter is anaconda.

Hope this helps,

~jr