Access Jupyter notebook running on Docker container

前端 未结 10 1386
南旧
南旧 2021-01-30 00:21

I created a docker image with python libraries and Jupyter. I start the container with the option -p 8888:8888, to link ports between host and container. When I l

相关标签:
10条回答
  • 2021-01-30 00:32

    You need to run your notebook on 0.0.0.0: jupyter notebook -i 0.0.0.0. Running on localhost make it available only from inside the container.

    0 讨论(0)
  • 2021-01-30 00:32

    The docker run command is mandatory to open a port for the container to allow the connection from a host browser, assigning the port to the docker container with -p, select your jupyter image from your docker images.

    docker run -it -p 8888:8888 image:version
    

    Inside the container launch the notebook assigning the port you opened:

    jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --allow-root
    

    Access the notebook through your desktops browser on http://localhost:8888 The notebook will prompt you for a token which was generated when you create the notebook.

    0 讨论(0)
  • 2021-01-30 00:41

    The below is how I get it running on Windows 7 with docker toolbox.

    If you are using docker toolbox, open up the Docker quickstart terminal, and note the IP here:

    docker is configured to use the default machine with IP 192.168.99.100
    For help getting started, check out the docs at https://docs.docker.com
    

    Once you run the docker commands from the tensorflow installation website:

    docker pull tensorflow/tensorflow                  # Download latest image
    docker run -it -p 8888:8888 tensorflow/tensorflow  # Start a Jupyter notebook server
    

    You will receive a message like this:

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://127.0.0.1:8888/?token=d6e80acaf08e09853dc72f6b0f022b8225f94f
    

    In the host, replace 127.0.0.1 with 192.168.99.100 and use the rest of that URL

    0 讨论(0)
  • 2021-01-30 00:43

    In the container you can run the following to make it available on your local machine (using your docker machine's ip address).

    jupyter notebook --ip 0.0.0.0 --allow-root

    You may not need to provide the --allow-root flag depending on your container's setup.

    0 讨论(0)
提交回复
热议问题