美文网首页【原创】Docker实战系列
Docker部署应用-部署Anaconda并安装JupyterL

Docker部署应用-部署Anaconda并安装JupyterL

作者: 复苏的兵马俑 | 来源:发表于2020-04-22 13:51 被阅读0次

    1、拉取Anaconda镜像

    [root@Server ~]# docker image ls -a
    REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
    nginx                   1.17.10             e791337790a6        4 days ago          127MB
    httpd                   2.4.43              bdc169d27d36        5 days ago          166MB
    elleflorio/svn-server   latest              8cc13133f6ed        3 months ago        49.7MB
    
    [root@Server ~]# docker pull continuumio/anaconda3:2020.02
    2020.02: Pulling from continuumio/anaconda3
    68ced04f60ab: Pull complete
    57047f2400d7: Pull complete
    8b26dd278326: Pull complete
    Digest: sha256:6502693fd278ba962af34c756ed9a9f0c3b6236a62f1e1fecb41f60c3f536d3c
    Status: Downloaded newer image for continuumio/anaconda3:2020.02
    docker.io/continuumio/anaconda3:2020.02
    
    [root@Server ~]# docker image ls -a
    REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
    nginx                   1.17.10             e791337790a6        4 days ago          127MB
    httpd                   2.4.43              bdc169d27d36        5 days ago          166MB
    continuumio/anaconda3   2020.02             bdb4a7e92a49        5 weeks ago         2.7GB
    elleflorio/svn-server   latest              8cc13133f6ed        3 months ago        49.7MB
    

    2、运行Anaconda

    [root@Server ~]# docker container ls -a
    CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                                   NAMES
    b573bedbb67c        elleflorio/svn-server:latest   "/init"                  2 hours ago         Up 2 hours          443/tcp, 0.0.0.0:3690->3690/tcp, 0.0.0.0:8001->80/tcp   svnsrv
    bf9d05430205        httpd:2.4.43                   "httpd-foreground"       14 hours ago        Up 2 hours          0.0.0.0:8002->80/tcp                                    apachesrv
    7a5b653ef143        nginx:1.17.10                  "nginx -g 'daemon of…"   19 hours ago        Up 18 hours         0.0.0.0:8000->80/tcp                                    nginxsrv
    
    [root@Server ~]# docker run -i -t -p 8003:8888 \
    > --name condasrv \
    > -v /data/jupyter/docs:/root/jupyter/docs \
    > -v /data/jupyter/conf.d:/root/.jupyter \
    > --privileged=true --restart=always continuumio/anaconda3:2020.02 /bin/bash
    (base) root@266b03596bdf:/#           (按住Ctrl,然后按p松开后按q即可退出容器但不停止容器)
    
    [root@Server ~]# docker container ls -a
    CONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                                   NAMES
    266b03596bdf        continuumio/anaconda3:2020.02   "/bin/bash"              21 seconds ago      Up 20 seconds       0.0.0.0:8003->8888/tcp                                  condasrv
    b573bedbb67c        elleflorio/svn-server:latest    "/init"                  11 hours ago        Up 11 hours         443/tcp, 0.0.0.0:3690->3690/tcp, 0.0.0.0:8001->80/tcp   svnsrv
    bf9d05430205        httpd:2.4.43                    "httpd-foreground"       23 hours ago        Up 12 hours         0.0.0.0:8002->80/tcp                                    apachesrv
    7a5b653ef143        nginx:1.17.10                   "nginx -g 'daemon of…"   28 hours ago        Up 27 hours         0.0.0.0:8000->80/tcp                                    nginxsrv
    

    3、升级conda版本

    3.1、修改Debian镜像源并安装vim
    [root@Server ~]# docker container exec -it condasrv /bin/bash
    (base) root@266b03596bdf:/#
    
    (base) root@266b03596bdf:/# sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
    
    (base) root@266b03596bdf:/# sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
    
    (base) root@266b03596bdf:/# apt-get update
    Hit:1 http://mirrors.ustc.edu.cn/debian buster InRelease
    Get:2 http://mirrors.ustc.edu.cn/debian-security buster/updates InRelease [65.4 kB]
    Hit:3 http://mirrors.ustc.edu.cn/debian buster-updates InRelease
    Get:4 http://mirrors.ustc.edu.cn/debian-security buster/updates/main amd64 Packages [189 kB]
    Fetched 254 kB in 8s (33.8 kB/s)
    Reading package lists... Done
    
    (base) root@266b03596bdf:/# apt-get install -y vim
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following additional packages will be installed:
      libgpm2 vim-common vim-runtime xxd
    Suggested packages:
      gpm ctags vim-doc vim-scripts
    The following NEW packages will be installed:
      libgpm2 vim vim-common vim-runtime xxd
    0 upgraded, 5 newly installed, 0 to remove and 6 not upgraded.
    Need to get 7425 kB of archives.
    After this operation, 33.8 MB of additional disk space will be used.
    Get:1 http://mirrors.ustc.edu.cn/debian buster/main amd64 xxd amd64 2:8.1.0875-5 [140 kB]
    Get:2 http://mirrors.ustc.edu.cn/debian buster/main amd64 vim-common all 2:8.1.0875-5 [195 kB]
    Get:3 http://mirrors.ustc.edu.cn/debian buster/main amd64 libgpm2 amd64 1.20.7-5 [35.1 kB]
    Get:4 http://mirrors.ustc.edu.cn/debian buster/main amd64 vim-runtime all 2:8.1.0875-5 [5775 kB]
    Get:5 http://mirrors.ustc.edu.cn/debian buster/main amd64 vim amd64 2:8.1.0875-5 [1280 kB]
    Fetched 7425 kB in 1s (13.4 MB/s)
    debconf: delaying package configuration, since apt-utils is not installed
    Selecting previously unselected package xxd.
    (Reading database ... 12564 files and directories currently installed.)
    Preparing to unpack .../xxd_2%3a8.1.0875-5_amd64.deb ...
    Unpacking xxd (2:8.1.0875-5) ...
    Selecting previously unselected package vim-common.
    Preparing to unpack .../vim-common_2%3a8.1.0875-5_all.deb ...
    Unpacking vim-common (2:8.1.0875-5) ...
    Selecting previously unselected package libgpm2:amd64.
    Preparing to unpack .../libgpm2_1.20.7-5_amd64.deb ...
    Unpacking libgpm2:amd64 (1.20.7-5) ...
    Selecting previously unselected package vim-runtime.
    Preparing to unpack .../vim-runtime_2%3a8.1.0875-5_all.deb ...
    Adding 'diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime'
    Adding 'diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime'
    Unpacking vim-runtime (2:8.1.0875-5) ...
    Selecting previously unselected package vim.
    Preparing to unpack .../vim_2%3a8.1.0875-5_amd64.deb ...
    Unpacking vim (2:8.1.0875-5) ...
    Setting up libgpm2:amd64 (1.20.7-5) ...
    Setting up xxd (2:8.1.0875-5) ...
    Setting up vim-common (2:8.1.0875-5) ...
    Setting up vim-runtime (2:8.1.0875-5) ...
    Setting up vim (2:8.1.0875-5) ...
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
    update-alternatives: warning: skip creation of /usr/share/man/da/man1/vi.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/de/man1/vi.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/fr/man1/vi.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/it/man1/vi.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ja/man1/vi.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/pl/man1/vi.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ru/man1/vi.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/man1/vi.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group vi) doesn't exist
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
    update-alternatives: warning: skip creation of /usr/share/man/da/man1/view.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/de/man1/view.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/fr/man1/view.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/it/man1/view.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ja/man1/view.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/pl/man1/view.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ru/man1/view.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/man1/view.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group view) doesn't exist
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
    update-alternatives: warning: skip creation of /usr/share/man/da/man1/ex.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/de/man1/ex.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/fr/man1/ex.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/it/man1/ex.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ja/man1/ex.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/pl/man1/ex.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ru/man1/ex.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/man1/ex.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group ex) doesn't exist
    update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode
    update-alternatives: warning: skip creation of /usr/share/man/da/man1/editor.1.gz because associated file /usr/share/man/da/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/de/man1/editor.1.gz because associated file /usr/share/man/de/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/fr/man1/editor.1.gz because associated file /usr/share/man/fr/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/it/man1/editor.1.gz because associated file /usr/share/man/it/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ja/man1/editor.1.gz because associated file /usr/share/man/ja/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/pl/man1/editor.1.gz because associated file /usr/share/man/pl/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/ru/man1/editor.1.gz because associated file /usr/share/man/ru/man1/vim.1.gz (of link group editor) doesn't exist
    update-alternatives: warning: skip creation of /usr/share/man/man1/editor.1.gz because associated file /usr/share/man/man1/vim.1.gz (of link group editor) doesn't exist
    Processing triggers for libc-bin (2.28-10) ...
    Processing triggers for mime-support (3.62) ...
    
    3.2、修改Anaconda镜像源
    (base) root@266b03596bdf:/# vi /root/.condarc
    channels:
      - defaults
    show_channel_urls: true
    channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
    default_channels:
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
      - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
    custom_channels:
      conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
      simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
    
    (base) root@266b03596bdf:/# conda clean -i
    
    3.3、升级conda版本
    (base) root@266b03596bdf:/# conda -V
    conda 4.8.2
    
    (base) root@266b03596bdf:/# conda update -y conda
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    ## Package Plan ##
    
      environment location: /opt/conda
    
      added / updated specs:
        - conda
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        conda-4.8.3                |           py37_0         2.8 MB
        ------------------------------------------------------------
                                               Total:         2.8 MB
    
    The following packages will be UPDATED:
    
      conda                                        4.8.2-py37_0 --> 4.8.3-py37_0
    
    
    
    Downloading and Extracting Packages
    conda-4.8.3          | 2.8 MB    | ################################################################## | 100%
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    
    (base) root@266b03596bdf:/# conda -V
    conda 4.8.3
    

    4、Anaconda创建环境

    (base) root@266b03596bdf:/# conda search "^python$"
    Loading channels: done
    # Name                       Version           Build  Channel
    python                        2.7.13     hac47a24_15  pkgs/main
    python                        2.7.13     heccc3f1_16  pkgs/main
    python                        2.7.13     hfff3488_13  pkgs/main
    python                        2.7.14     h1571d57_29  pkgs/main
    python                        2.7.14     h1571d57_30  pkgs/main
    python                        2.7.14     h1571d57_31  pkgs/main
    python                        2.7.14     h1aa7481_19  pkgs/main
    python                        2.7.14     h435b27a_18  pkgs/main
    python                        2.7.14     h89e7a4a_22  pkgs/main
    python                        2.7.14     h91f54f5_26  pkgs/main
    python                        2.7.14     h931c8b0_15  pkgs/main
    python                        2.7.14     h9b67528_20  pkgs/main
    python                        2.7.14     ha6fc286_23  pkgs/main
    python                        2.7.14     hc2b0042_21  pkgs/main
    python                        2.7.14     hdd48546_24  pkgs/main
    python                        2.7.14     hf918d8d_16  pkgs/main
    python                        2.7.15      h1571d57_0  pkgs/main
    python                        2.7.15      h77bded6_1  pkgs/main
    python                        2.7.15      h77bded6_2  pkgs/main
    python                        2.7.15      h9bab390_2  pkgs/main
    python                        2.7.15      h9bab390_4  pkgs/main
    python                        2.7.15      h9bab390_6  pkgs/main
    python                        2.7.16      h8b3fad2_1  pkgs/main
    python                        2.7.16      h8b3fad2_2  pkgs/main
    python                        2.7.16      h8b3fad2_3  pkgs/main
    python                        2.7.16      h8b3fad2_4  pkgs/main
    python                        2.7.16      h8b3fad2_5  pkgs/main
    python                        2.7.16      h9bab390_0  pkgs/main
    python                        2.7.16      h9bab390_6  pkgs/main
    python                        2.7.16      h9bab390_7  pkgs/main
    python                        2.7.17      h9bab390_0  pkgs/main
    python                         3.5.4     h00c01ad_19  pkgs/main
    python                         3.5.4     h0b4c808_22  pkgs/main
    python                         3.5.4     h2170f06_12  pkgs/main
    python                         3.5.4     h3075507_18  pkgs/main
    python                         3.5.4     h417fded_24  pkgs/main
    python                         3.5.4     h56e0582_23  pkgs/main
    python                         3.5.4     h72f0b78_15  pkgs/main
    python                         3.5.4     hb43c6bb_21  pkgs/main
    python                         3.5.4     hc053d89_14  pkgs/main
    python                         3.5.4     hc3d631a_27  pkgs/main
    python                         3.5.4     he2c66cf_20  pkgs/main
    python                         3.5.5      hc3d631a_0  pkgs/main
    python                         3.5.5      hc3d631a_1  pkgs/main
    python                         3.5.5      hc3d631a_3  pkgs/main
    python                         3.5.5      hc3d631a_4  pkgs/main
    python                         3.5.6      hc3d631a_0  pkgs/main
    python                         3.6.2     h02fb82a_12  pkgs/main
    python                         3.6.2     h0b30769_14  pkgs/main
    python                         3.6.2     h33255ae_18  pkgs/main
    python                         3.6.2     hca45abc_19  pkgs/main
    python                         3.6.2     hdfe5801_15  pkgs/main
    python                         3.6.3      h0ef2715_3  pkgs/main
    python                         3.6.3      h1284df2_4  pkgs/main
    python                         3.6.3      h6c0c0dc_5  pkgs/main
    python                         3.6.3      hc9025b9_1  pkgs/main
    python                         3.6.3      hcad60d5_0  pkgs/main
    python                         3.6.3      hefd0734_2  pkgs/main
    python                         3.6.4      hc3d631a_0  pkgs/main
    python                         3.6.4      hc3d631a_1  pkgs/main
    python                         3.6.4      hc3d631a_3  pkgs/main
    python                         3.6.5      hc3d631a_0  pkgs/main
    python                         3.6.5      hc3d631a_1  pkgs/main
    python                         3.6.5      hc3d631a_2  pkgs/main
    python                         3.6.6      h6e4f718_2  pkgs/main
    python                         3.6.6      hc3d631a_0  pkgs/main
    python                         3.6.7      h0371630_0  pkgs/main
    python                         3.6.8      h0371630_0  pkgs/main
    python                         3.6.9      h265db76_0  pkgs/main
    python                        3.6.10      h0371630_0  pkgs/main
    python                        3.6.10      h191fe78_1  pkgs/main
    python                        3.6.10      hcf32534_1  pkgs/main
    python                         3.7.0      h6e4f718_3  pkgs/main
    python                         3.7.0      hc3d631a_0  pkgs/main
    python                         3.7.1      h0371630_3  pkgs/main
    python                         3.7.1      h0371630_7  pkgs/main
    python                         3.7.2      h0371630_0  pkgs/main
    python                         3.7.3      h0371630_0  pkgs/main
    python                         3.7.4      h265db76_0  pkgs/main
    python                         3.7.4      h265db76_1  pkgs/main
    python                         3.7.5      h0371630_0  pkgs/main
    python                         3.7.6      h0371630_2  pkgs/main
    python                         3.7.7 h191fe78_0_cpython  pkgs/main
    python                         3.7.7 hcf32534_0_cpython  pkgs/main
    python                         3.8.0      h0371630_0  pkgs/main
    python                         3.8.0      h0371630_1  pkgs/main
    python                         3.8.0      h0371630_2  pkgs/main
    python                         3.8.1      h0371630_1  pkgs/main
    python                         3.8.2      h191fe78_0  pkgs/main
    python                         3.8.2      hcf32534_0  pkgs/main
    
    (base) root@266b03596bdf:/# conda env list
    # conda environments:
    #
    base                  *  /opt/conda
    
    (base) root@266b03596bdf:/# conda create -y --name py382 python=3.8.2
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    ## Package Plan ##
    
      environment location: /opt/conda/envs/py382
    
      added / updated specs:
        - python=3.8.2
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        _libgcc_mutex-0.1          |             main           3 KB
        ca-certificates-2020.1.1   |                0         125 KB
        certifi-2020.4.5.1         |           py38_0         156 KB
        ld_impl_linux-64-2.33.1    |       h53a641e_7         568 KB
        libedit-3.1.20181209       |       hc058e9b_0         163 KB
        libffi-3.2.1               |       hd88cf55_4          40 KB
        libgcc-ng-9.1.0            |       hdf63c60_0         5.1 MB
        libstdcxx-ng-9.1.0         |       hdf63c60_0         3.1 MB
        ncurses-6.2                |       he6710b0_0         1.1 MB
        openssl-1.1.1g             |       h7b6447c_0         2.5 MB
        pip-20.0.2                 |           py38_1         1.7 MB
        python-3.8.2               |       hcf32534_0        49.6 MB
        readline-8.0               |       h7b6447c_0         356 KB
        setuptools-46.1.3          |           py38_0         523 KB
        sqlite-3.31.1              |       h62c20be_1         2.0 MB
        tk-8.6.8                   |       hbc83047_0         2.8 MB
        wheel-0.34.2               |           py38_0          51 KB
        xz-5.2.5                   |       h7b6447c_0         438 KB
        zlib-1.2.11                |       h7b6447c_3         103 KB
        ------------------------------------------------------------
                                               Total:        70.3 MB
    
    The following NEW packages will be INSTALLED:
    
      _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
      ca-certificates    pkgs/main/linux-64::ca-certificates-2020.1.1-0
      certifi            pkgs/main/linux-64::certifi-2020.4.5.1-py38_0
      ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.33.1-h53a641e_7
      libedit            pkgs/main/linux-64::libedit-3.1.20181209-hc058e9b_0
      libffi             pkgs/main/linux-64::libffi-3.2.1-hd88cf55_4
      libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
      libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
      ncurses            pkgs/main/linux-64::ncurses-6.2-he6710b0_0
      openssl            pkgs/main/linux-64::openssl-1.1.1g-h7b6447c_0
      pip                pkgs/main/linux-64::pip-20.0.2-py38_1
      python             pkgs/main/linux-64::python-3.8.2-hcf32534_0
      readline           pkgs/main/linux-64::readline-8.0-h7b6447c_0
      setuptools         pkgs/main/linux-64::setuptools-46.1.3-py38_0
      sqlite             pkgs/main/linux-64::sqlite-3.31.1-h62c20be_1
      tk                 pkgs/main/linux-64::tk-8.6.8-hbc83047_0
      wheel              pkgs/main/linux-64::wheel-0.34.2-py38_0
      xz                 pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
      zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3
    
    
    
    Downloading and Extracting Packages
    ncurses-6.2          | 1.1 MB    | ################################################################## | 100%
    ld_impl_linux-64-2.3 | 568 KB    | ################################################################## | 100%
    _libgcc_mutex-0.1    | 3 KB      | ################################################################## | 100%
    xz-5.2.5             | 438 KB    | ################################################################## | 100%
    zlib-1.2.11          | 103 KB    | ################################################################## | 100%
    libffi-3.2.1         | 40 KB     | ################################################################## | 100%
    ca-certificates-2020 | 125 KB    | ################################################################## | 100%
    openssl-1.1.1g       | 2.5 MB    | ################################################################## | 100%
    setuptools-46.1.3    | 523 KB    | ################################################################## | 100%
    readline-8.0         | 356 KB    | ################################################################## | 100%
    sqlite-3.31.1        | 2.0 MB    | ################################################################## | 100%
    pip-20.0.2           | 1.7 MB    | ################################################################## | 100%
    tk-8.6.8             | 2.8 MB    | ################################################################## | 100%
    certifi-2020.4.5.1   | 156 KB    | ################################################################## | 100%
    python-3.8.2         | 49.6 MB   | ################################################################## | 100%
    libgcc-ng-9.1.0      | 5.1 MB    | ################################################################## | 100%
    wheel-0.34.2         | 51 KB     | ################################################################## | 100%
    libedit-3.1.20181209 | 163 KB    | ################################################################## | 100%
    libstdcxx-ng-9.1.0   | 3.1 MB    | ################################################################## | 100%
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    #
    # To activate this environment, use
    #
    #     $ conda activate py382
    #
    # To deactivate an active environment, use
    #
    #     $ conda deactivate
    
    (base) root@266b03596bdf:/# conda env list
    # conda environments:
    #
    base                  *  /opt/conda
    py382                    /opt/conda/envs/py382
    

    5、Anaconda激活环境

    (base) root@266b03596bdf:/# conda activate py382
    (py382) root@266b03596bdf:/#
    

    6、安装JupyterLab

    6.1、安装nodejs、node-gyp和npm并更改npm源
    (py382) root@266b03596bdf:/# apt install -y nodejs node-gyp npm
    
    (py382) root@266b03596bdf:/# npm config get registry
    npm WARN npm npm does not support Node.js v10.15.2
    npm WARN npm You should probably upgrade to a newer version of node as we
    npm WARN npm can't make any promises that npm will work with this version.
    npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
    npm WARN npm You can find the latest version at https://nodejs.org/
    https://registry.npmjs.org/
    
    # 临时使用
    (py382) root@266b03596bdf:/# npm --registry https://registry.npm.taobao.org install express
    
    # 永久生效
    (py382) root@266b03596bdf:/# npm config set registry https://registry.npm.taobao.org
    
    (py382) root@266b03596bdf:/# npm config get registry
    npm WARN npm npm does not support Node.js v10.15.2
    npm WARN npm You should probably upgrade to a newer version of node as we
    npm WARN npm can't make any promises that npm will work with this version.
    npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
    npm WARN npm You can find the latest version at https://nodejs.org/
    https://registry.npm.taobao.org/
    
    6.2、修改pip源
    # 临时使用
    (py382) root@266b03596bdf:/# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
    
    # 永久使用
    (py382) root@266b03596bdf:/# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    Writing to /root/.config/pip/pip.conf
    
    6.3、安装JupyterLab
    # 安装Jupyter
    (py382) root@266b03596bdf:/# conda install -y jupyter
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    ## Package Plan ##
    
      environment location: /opt/conda/envs/py382
    
      added / updated specs:
        - jupyter
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        attrs-19.3.0               |             py_0          39 KB
        backcall-0.1.0             |           py38_0          21 KB
        bleach-3.1.4               |             py_0         114 KB
        dbus-1.13.12               |       h746ee38_0         501 KB
        decorator-4.4.2            |             py_0          14 KB
        defusedxml-0.6.0           |             py_0          23 KB
        entrypoints-0.3            |           py38_0          10 KB
        expat-2.2.6                |       he6710b0_0         146 KB
        fontconfig-2.13.0          |       h9420a91_0         227 KB
        freetype-2.9.1             |       h8a8886c_1         550 KB
        glib-2.63.1                |       h5a9c865_0         2.9 MB
        gmp-6.1.2                  |       h6c8ec71_1         514 KB
        gst-plugins-base-1.14.0    |       hbbd80ab_1         4.8 MB
        gstreamer-1.14.0           |       hb453b48_1         3.1 MB
        icu-58.2                   |       h9c2bf20_1        10.3 MB
        importlib_metadata-1.5.0   |           py38_0          48 KB
        ipykernel-5.1.4            |   py38h39e3cac_0         172 KB
        ipython-7.13.0             |   py38h5ca1d4c_0         979 KB
        ipython_genutils-0.2.0     |           py38_0          40 KB
        ipywidgets-7.5.1           |             py_0         107 KB
        jedi-0.16.0                |           py38_1         781 KB
        jinja2-2.11.1              |             py_0         104 KB
        jpeg-9b                    |       h024ee3a_2         214 KB
        jsonschema-3.2.0           |           py38_0          96 KB
        jupyter-1.0.0              |           py38_7           7 KB
        jupyter_client-6.1.2       |             py_0          82 KB
        jupyter_console-6.1.0      |             py_0          24 KB
        jupyter_core-4.6.3         |           py38_0          75 KB
        libpng-1.6.37              |       hbc83047_0         278 KB
        libsodium-1.0.16           |       h1bed415_0         214 KB
        libuuid-1.0.3              |       h1bed415_2          15 KB
        libxcb-1.13                |       h1bed415_1         421 KB
        libxml2-2.9.9              |       hea5a465_1         1.6 MB
        markupsafe-1.1.1           |   py38h7b6447c_0          33 KB
        mistune-0.8.4              |py38h7b6447c_1000          55 KB
        nbconvert-5.6.1            |           py38_0         456 KB
        nbformat-5.0.4             |             py_0          89 KB
        notebook-6.0.3             |           py38_0         4.0 MB
        pandoc-2.2.3.2             |                0        14.0 MB
        pandocfilters-1.4.2        |           py38_1          13 KB
        parso-0.6.2                |             py_0          70 KB
        pcre-8.43                  |       he6710b0_0         209 KB
        pexpect-4.8.0              |           py38_0          81 KB
        pickleshare-0.7.5          |        py38_1000          13 KB
        prometheus_client-0.7.1    |             py_0          42 KB
        prompt-toolkit-3.0.4       |             py_0         244 KB
        prompt_toolkit-3.0.4       |                0          11 KB
        ptyprocess-0.6.0           |           py38_0          23 KB
        pygments-2.6.1             |             py_0         654 KB
        pyqt-5.9.2                 |   py38h05f1152_4         4.5 MB
        pyrsistent-0.16.0          |   py38h7b6447c_0          94 KB
        python-dateutil-2.8.1      |             py_0         224 KB
        pyzmq-18.1.1               |   py38he6710b0_0         465 KB
        qt-5.9.7                   |       h5867ecd_1        68.5 MB
        qtconsole-4.7.3            |             py_0          94 KB
        qtpy-1.9.0                 |             py_0          39 KB
        send2trash-1.5.0           |           py38_0          17 KB
        sip-4.19.13                |   py38he6710b0_0         277 KB
        six-1.14.0                 |           py38_0          27 KB
        terminado-0.8.3            |           py38_0          26 KB
        testpath-0.4.4             |             py_0          88 KB
        tornado-6.0.4              |   py38h7b6447c_1         603 KB
        traitlets-4.3.3            |           py38_0         138 KB
        wcwidth-0.1.9              |             py_0          24 KB
        webencodings-0.5.1         |           py38_1          20 KB
        widgetsnbextension-3.5.1   |           py38_0         866 KB
        zeromq-4.3.1               |       he6710b0_3         496 KB
        zipp-2.2.0                 |             py_0          12 KB
        ------------------------------------------------------------
                                               Total:       124.7 MB
    
    The following NEW packages will be INSTALLED:
    
      attrs              pkgs/main/noarch::attrs-19.3.0-py_0
      backcall           pkgs/main/linux-64::backcall-0.1.0-py38_0
      bleach             pkgs/main/noarch::bleach-3.1.4-py_0
      dbus               pkgs/main/linux-64::dbus-1.13.12-h746ee38_0
      decorator          pkgs/main/noarch::decorator-4.4.2-py_0
      defusedxml         pkgs/main/noarch::defusedxml-0.6.0-py_0
      entrypoints        pkgs/main/linux-64::entrypoints-0.3-py38_0
      expat              pkgs/main/linux-64::expat-2.2.6-he6710b0_0
      fontconfig         pkgs/main/linux-64::fontconfig-2.13.0-h9420a91_0
      freetype           pkgs/main/linux-64::freetype-2.9.1-h8a8886c_1
      glib               pkgs/main/linux-64::glib-2.63.1-h5a9c865_0
      gmp                pkgs/main/linux-64::gmp-6.1.2-h6c8ec71_1
      gst-plugins-base   pkgs/main/linux-64::gst-plugins-base-1.14.0-hbbd80ab_1
      gstreamer          pkgs/main/linux-64::gstreamer-1.14.0-hb453b48_1
      icu                pkgs/main/linux-64::icu-58.2-h9c2bf20_1
      importlib_metadata pkgs/main/linux-64::importlib_metadata-1.5.0-py38_0
      ipykernel          pkgs/main/linux-64::ipykernel-5.1.4-py38h39e3cac_0
      ipython            pkgs/main/linux-64::ipython-7.13.0-py38h5ca1d4c_0
      ipython_genutils   pkgs/main/linux-64::ipython_genutils-0.2.0-py38_0
      ipywidgets         pkgs/main/noarch::ipywidgets-7.5.1-py_0
      jedi               pkgs/main/linux-64::jedi-0.16.0-py38_1
      jinja2             pkgs/main/noarch::jinja2-2.11.1-py_0
      jpeg               pkgs/main/linux-64::jpeg-9b-h024ee3a_2
      jsonschema         pkgs/main/linux-64::jsonschema-3.2.0-py38_0
      jupyter            pkgs/main/linux-64::jupyter-1.0.0-py38_7
      jupyter_client     pkgs/main/noarch::jupyter_client-6.1.2-py_0
      jupyter_console    pkgs/main/noarch::jupyter_console-6.1.0-py_0
      jupyter_core       pkgs/main/linux-64::jupyter_core-4.6.3-py38_0
      libpng             pkgs/main/linux-64::libpng-1.6.37-hbc83047_0
      libsodium          pkgs/main/linux-64::libsodium-1.0.16-h1bed415_0
      libuuid            pkgs/main/linux-64::libuuid-1.0.3-h1bed415_2
      libxcb             pkgs/main/linux-64::libxcb-1.13-h1bed415_1
      libxml2            pkgs/main/linux-64::libxml2-2.9.9-hea5a465_1
      markupsafe         pkgs/main/linux-64::markupsafe-1.1.1-py38h7b6447c_0
      mistune            pkgs/main/linux-64::mistune-0.8.4-py38h7b6447c_1000
      nbconvert          pkgs/main/linux-64::nbconvert-5.6.1-py38_0
      nbformat           pkgs/main/noarch::nbformat-5.0.4-py_0
      notebook           pkgs/main/linux-64::notebook-6.0.3-py38_0
      pandoc             pkgs/main/linux-64::pandoc-2.2.3.2-0
      pandocfilters      pkgs/main/linux-64::pandocfilters-1.4.2-py38_1
      parso              pkgs/main/noarch::parso-0.6.2-py_0
      pcre               pkgs/main/linux-64::pcre-8.43-he6710b0_0
      pexpect            pkgs/main/linux-64::pexpect-4.8.0-py38_0
      pickleshare        pkgs/main/linux-64::pickleshare-0.7.5-py38_1000
      prometheus_client  pkgs/main/noarch::prometheus_client-0.7.1-py_0
      prompt-toolkit     pkgs/main/noarch::prompt-toolkit-3.0.4-py_0
      prompt_toolkit     pkgs/main/noarch::prompt_toolkit-3.0.4-0
      ptyprocess         pkgs/main/linux-64::ptyprocess-0.6.0-py38_0
      pygments           pkgs/main/noarch::pygments-2.6.1-py_0
      pyqt               pkgs/main/linux-64::pyqt-5.9.2-py38h05f1152_4
      pyrsistent         pkgs/main/linux-64::pyrsistent-0.16.0-py38h7b6447c_0
      python-dateutil    pkgs/main/noarch::python-dateutil-2.8.1-py_0
      pyzmq              pkgs/main/linux-64::pyzmq-18.1.1-py38he6710b0_0
      qt                 pkgs/main/linux-64::qt-5.9.7-h5867ecd_1
      qtconsole          pkgs/main/noarch::qtconsole-4.7.3-py_0
      qtpy               pkgs/main/noarch::qtpy-1.9.0-py_0
      send2trash         pkgs/main/linux-64::send2trash-1.5.0-py38_0
      sip                pkgs/main/linux-64::sip-4.19.13-py38he6710b0_0
      six                pkgs/main/linux-64::six-1.14.0-py38_0
      terminado          pkgs/main/linux-64::terminado-0.8.3-py38_0
      testpath           pkgs/main/noarch::testpath-0.4.4-py_0
      tornado            pkgs/main/linux-64::tornado-6.0.4-py38h7b6447c_1
      traitlets          pkgs/main/linux-64::traitlets-4.3.3-py38_0
      wcwidth            pkgs/main/noarch::wcwidth-0.1.9-py_0
      webencodings       pkgs/main/linux-64::webencodings-0.5.1-py38_1
      widgetsnbextension pkgs/main/linux-64::widgetsnbextension-3.5.1-py38_0
      zeromq             pkgs/main/linux-64::zeromq-4.3.1-he6710b0_3
      zipp               pkgs/main/noarch::zipp-2.2.0-py_0
    
    Downloading and Extracting Packages
    prompt-toolkit-3.0.4 | 244 KB    | ################################################################## | 100%
    ipywidgets-7.5.1     | 107 KB    | ################################################################## | 100%
    mistune-0.8.4        | 55 KB     | ################################################################## | 100%
    prometheus_client-0. | 42 KB     | ################################################################## | 100%
    ipykernel-5.1.4      | 172 KB    | ################################################################## | 100%
    icu-58.2             | 10.3 MB   | ################################################################## | 100%
    jupyter_client-6.1.2 | 82 KB     | ################################################################## | 100%
    ptyprocess-0.6.0     | 23 KB     | ################################################################## | 100%
    markupsafe-1.1.1     | 33 KB     | ################################################################## | 100%
    dbus-1.13.12         | 501 KB    | ################################################################## | 100%
    zeromq-4.3.1         | 496 KB    | ################################################################## | 100%
    freetype-2.9.1       | 550 KB    | ################################################################## | 100%
    backcall-0.1.0       | 21 KB     | ################################################################## | 100%
    zipp-2.2.0           | 12 KB     | ################################################################## | 100%
    parso-0.6.2          | 70 KB     | ################################################################## | 100%
    decorator-4.4.2      | 14 KB     | ################################################################## | 100%
    six-1.14.0           | 27 KB     | ################################################################## | 100%
    notebook-6.0.3       | 4.0 MB    | ################################################################## | 100%
    jupyter-1.0.0        | 7 KB      | ################################################################## | 100%
    libuuid-1.0.3        | 15 KB     | ################################################################## | 100%
    importlib_metadata-1 | 48 KB     | ################################################################## | 100%
    nbconvert-5.6.1      | 456 KB    | ################################################################## | 100%
    entrypoints-0.3      | 10 KB     | ################################################################## | 100%
    jedi-0.16.0          | 781 KB    | ################################################################## | 100%
    ipython-7.13.0       | 979 KB    | ################################################################## | 100%
    qtconsole-4.7.3      | 94 KB     | ################################################################## | 100%
    gstreamer-1.14.0     | 3.1 MB    | ################################################################## | 100%
    jinja2-2.11.1        | 104 KB    | ################################################################## | 100%
    ipython_genutils-0.2 | 40 KB     | ################################################################## | 100%
    pandocfilters-1.4.2  | 13 KB     | ################################################################## | 100%
    tornado-6.0.4        | 603 KB    | ################################################################## | 100%
    wcwidth-0.1.9        | 24 KB     | ################################################################## | 100%
    glib-2.63.1          | 2.9 MB    | ################################################################## | 100%
    jupyter_core-4.6.3   | 75 KB     | ################################################################## | 100%
    jpeg-9b              | 214 KB    | ################################################################## | 100%
    pickleshare-0.7.5    | 13 KB     | ################################################################## | 100%
    libpng-1.6.37        | 278 KB    | ################################################################## | 100%
    pcre-8.43            | 209 KB    | ################################################################## | 100%
    python-dateutil-2.8. | 224 KB    | ################################################################## | 100%
    prompt_toolkit-3.0.4 | 11 KB     | ################################################################## | 100%
    widgetsnbextension-3 | 866 KB    | ################################################################## | 100%
    terminado-0.8.3      | 26 KB     | ################################################################## | 100%
    testpath-0.4.4       | 88 KB     | ################################################################## | 100%
    jsonschema-3.2.0     | 96 KB     | ################################################################## | 100%
    libxcb-1.13          | 421 KB    | ################################################################## | 100%
    libxml2-2.9.9        | 1.6 MB    | ################################################################## | 100%
    pyzmq-18.1.1         | 465 KB    | ################################################################## | 100%
    gmp-6.1.2            | 514 KB    | ################################################################## | 100%
    pyqt-5.9.2           | 4.5 MB    | ################################################################## | 100%
    pyrsistent-0.16.0    | 94 KB     | ################################################################## | 100%
    traitlets-4.3.3      | 138 KB    | ################################################################## | 100%
    bleach-3.1.4         | 114 KB    | ################################################################## | 100%
    pygments-2.6.1       | 654 KB    | ################################################################## | 100%
    nbformat-5.0.4       | 89 KB     | ################################################################## | 100%
    qtpy-1.9.0           | 39 KB     | ################################################################## | 100%
    pexpect-4.8.0        | 81 KB     | ################################################################## | 100%
    expat-2.2.6          | 146 KB    | ################################################################## | 100%
    gst-plugins-base-1.1 | 4.8 MB    | ################################################################## | 100%
    libsodium-1.0.16     | 214 KB    | ################################################################## | 100%
    fontconfig-2.13.0    | 227 KB    | ################################################################## | 100%
    pandoc-2.2.3.2       | 14.0 MB   | ################################################################## | 100%
    attrs-19.3.0         | 39 KB     | ################################################################## | 100%
    qt-5.9.7             | 68.5 MB   | ################################################################## | 100%
    sip-4.19.13          | 277 KB    | ################################################################## | 100%
    jupyter_console-6.1. | 24 KB     | ################################################################## | 100%
    defusedxml-0.6.0     | 23 KB     | ################################################################## | 100%
    send2trash-1.5.0     | 17 KB     | ################################################################## | 100%
    webencodings-0.5.1   | 20 KB     | ################################################################## | 100%
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    
    # 安装jupyterlab
    (py382) root@266b03596bdf:/# conda install -y jupyterlab
    Collecting package metadata (current_repodata.json): done
    Solving environment: done
    
    ## Package Plan ##
    
      environment location: /opt/conda/envs/py382
    
      added / updated specs:
        - jupyterlab
    
    
    The following packages will be downloaded:
    
        package                    |            build
        ---------------------------|-----------------
        asn1crypto-1.3.0           |           py38_0         164 KB
        cffi-1.14.0                |   py38h2e261b9_0         226 KB
        chardet-3.0.4              |        py38_1003         174 KB
        cryptography-2.8           |   py38h1ba5d50_0         555 KB
        idna-2.9                   |             py_1          49 KB
        json5-0.9.4                |             py_0          21 KB
        jupyterlab-1.2.6           |     pyhf63ae98_0         2.8 MB
        jupyterlab_server-1.1.0    |             py_0          27 KB
        pycparser-2.20             |             py_0          92 KB
        pyopenssl-19.1.0           |           py38_0          88 KB
        pysocks-1.7.1              |           py38_0          28 KB
        requests-2.23.0            |           py38_0          93 KB
        urllib3-1.25.8             |           py38_0         170 KB
        ------------------------------------------------------------
                                               Total:         4.4 MB
    
    The following NEW packages will be INSTALLED:
    
      asn1crypto         pkgs/main/linux-64::asn1crypto-1.3.0-py38_0
      cffi               pkgs/main/linux-64::cffi-1.14.0-py38h2e261b9_0
      chardet            pkgs/main/linux-64::chardet-3.0.4-py38_1003
      cryptography       pkgs/main/linux-64::cryptography-2.8-py38h1ba5d50_0
      idna               pkgs/main/noarch::idna-2.9-py_1
      json5              pkgs/main/noarch::json5-0.9.4-py_0
      jupyterlab         pkgs/main/noarch::jupyterlab-1.2.6-pyhf63ae98_0
      jupyterlab_server  pkgs/main/noarch::jupyterlab_server-1.1.0-py_0
      pycparser          pkgs/main/noarch::pycparser-2.20-py_0
      pyopenssl          pkgs/main/linux-64::pyopenssl-19.1.0-py38_0
      pysocks            pkgs/main/linux-64::pysocks-1.7.1-py38_0
      requests           pkgs/main/linux-64::requests-2.23.0-py38_0
      urllib3            pkgs/main/linux-64::urllib3-1.25.8-py38_0
    
    
    
    Downloading and Extracting Packages
    cffi-1.14.0          | 226 KB    | ################################################################## | 100%
    pyopenssl-19.1.0     | 88 KB     | ################################################################## | 100%
    chardet-3.0.4        | 174 KB    | ################################################################## | 100%
    urllib3-1.25.8       | 170 KB    | ################################################################## | 100%
    asn1crypto-1.3.0     | 164 KB    | ################################################################## | 100%
    cryptography-2.8     | 555 KB    | ################################################################## | 100%
    idna-2.9             | 49 KB     | ################################################################## | 100%
    requests-2.23.0      | 93 KB     | ################################################################## | 100%
    pysocks-1.7.1        | 28 KB     | ################################################################## | 100%
    jupyterlab_server-1. | 27 KB     | ################################################################## | 100%
    jupyterlab-1.2.6     | 2.8 MB    | ################################################################## | 100%
    json5-0.9.4          | 21 KB     | ################################################################## | 100%
    pycparser-2.20       | 92 KB     | ################################################################## | 100%
    Preparing transaction: done
    Verifying transaction: done
    Executing transaction: done
    

    7、配置JupyterLab

    # 设置密码,生成sha1字符串
    (py382) root@266b03596bdf:/# python
    Python 3.8.2 (default, Mar 26 2020, 15:53:00)
    [GCC 7.3.0] :: Anaconda, Inc. on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from notebook.auth import passwd
    >>> passwd()
    Enter password:
    Verify password:
    'sha1:c986ec1eba56:f94594c9acac2bcd57d50ee9073f85a6778cfe23'
    >>> quit()
    (py382) root@266b03596bdf:/#
    
    # 生成jupyter配置文件
    (py382) root@266b03596bdf:/# jupyter lab --generate-config
    Writing default config to: /root/.jupyter/jupyter_notebook_config.py
    
    # 修改配置文件
    [root@Server ~]# vi /data/jupyter/conf.d/jupyter_notebook_config.py
    ## The IP address the notebook server will listen on.
    #c.NotebookApp.ip = 'localhost'
    c.NotebookApp.ip = '*'
    
    ## Whether to open in a browser after starting. The specific browser used is
    #  platform dependent and determined by the python standard library `webbrowser`
    #  module, unless it is overridden using the --browser (NotebookApp.browser)
    #  configuration option.
    #c.NotebookApp.open_browser = True
    c.NotebookApp.open_browser = False
    
    ## Hashed password to use for web authentication.
    #
    #  To generate, type in a python/IPython shell:
    #
    #    from notebook.auth import passwd; passwd()
    #
    #  The string should be of the form type:salt:hashed-password.
    #c.NotebookApp.password = ''
    c.NotebookApp.password = 'sha1:c986ec1eba56:f94594c9acac2bcd57d50ee9073f85a6778cfe23'
    
    ## The port the notebook server will listen on.
    #c.NotebookApp.port = 8888
    c.NotebookApp.port = 8888
    
    ## The directory to use for notebooks and kernels.
    #c.NotebookApp.notebook_dir = ''
    c.NotebookApp.notebook_dir = '/root/jupyter/docs'
    
    ## Allow requests where the Host header doesn't point to a local server
    #
    #  By default, requests get a 403 forbidden response if the 'Host' header shows
    #  that the browser thinks it's on a non-local domain. Setting this option to
    #  True disables this check.
    #
    #  This protects against 'DNS rebinding' attacks, where a remote web server
    #  serves you a page and then changes its DNS to send later requests to a local
    #  IP, bypassing same-origin checks.
    #
    #  Local IP addresses (such as 127.0.0.1 and ::1) are allowed as local, along
    #  with hostnames configured in local_hostnames.
    #c.NotebookApp.allow_remote_access = False
    c.NotebookApp.allow_remote_access = True
    

    8、启动JupyterLab

    (py382) root@266b03596bdf:/# nohup jupyter lab --allow-root &
    [1] 2579
    (py382) root@266b03596bdf:/# nohup: ignoring input and appending output to 'nohup.out'
    

    9、验证远程访问JupyterLab

    相关文章

      网友评论

        本文标题:Docker部署应用-部署Anaconda并安装JupyterL

        本文链接:https://www.haomeiwen.com/subject/dcabihtx.html