Install Jupyter on Docker

    版本為 21:36, 23 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    Select an image

    jupyter/base-notebook

    • Minimally-functional Jupyter Notebook server (e.g., no pandoc for saving notebooks as PDFs)
    • Miniconda Python 3.x in /opt/conda
    • No preinstalled scientific computing packages

     

    jupyter/minimal-notebook

    • Everything in jupyter/base-notebook
    • Pandoc and TeX Live for notebook document conversion

     

    jupyter/scipy-notebook

    • Everything in jupyter/minimal-notebook and its ancestor images
    • pandas, numexpr, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh, sqlalchemy, hdf5, vincent, beautifulsoup, protobuf, and xlrd packages
    • ipywidgets for interactive visualizations in Python notebooks
    • Facets for visualizing machine learning datasets

     

    jupyter/tensorflow-notebook

    • Everything in jupyter/scipy-notebook and its ancestor images
    • tensorflow and keras machine learning libraries

    Start to install

    docker run -p 8888:8888 jupyter/tensorflow-notebook
    

    If you see the output as follows, the installation has been successfully completed.

        [I 08:06:45.922 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
        [C 08:06:45.924 NotebookApp]
        
            Copy/paste this URL into your browser when you connect for the first time,
            to login with a token:
                http://(5cb9602a2a30 or 127.0.0.1):8888/?token=e4c38ce33c5ea6f46792a9ae95d87f75a281300af4fcaf13

    Verify the Jupyter

    Open the firefox and go to the URL http://server-ip-address:8888/?token=e4c38ce33c5ea6f46792a9ae95d87f75a281300af4fcaf13

    Ctrl + c to exit the docker console.

    Create a script to start the jupyter service

    run-jupyter.sh:
    ```
    #!/usr/bin/env bash
    LOCAL_DIR="$HOME/jupyter-tensorflow/work"

    docker run -d --restart=always --name=jupyter \
     -p 8888:8888 \
     -v $LOCAL_DIR:/home/jovyan/work \
     jupyter/tensorflow-notebook

    docker ps
    ```

    stop-jupyter.sh:
    ```
    #!/bin/bash
    NAME="jupyter"

    docker stop $NAME
    docker rm $NAME
    docker ps
    ```

    Change the permission of the scripts
    ```
    chmod 0755 run-jupyter.sh stop-jupyter.sh
    ```

    ### Manually Start Jupyter
    Create the directory
    ```
    mkdir -p jupyter-tensorflow/work
    ```

    Start the jupyter:
    ```
    ./run-jupyter.sh
    ```

    Get the token info:
    ```
    docker logs --tail 3 jupyter
    ```

    Stop the jupyter:
    ```
    ./stop-jupyter.sh
    ```

    Powered by MindTouch Core