项目作者: mooyxu

项目描述 :
A container image of jupyter notebook development environment with anaconda3, python2.7, some other runtimes and packages.
高级语言: Python
项目地址: git://github.com/mooyxu/notebook.git
创建时间: 2019-05-31T16:09:43Z
项目社区:https://github.com/mooyxu/notebook

开源协议:GNU General Public License v3.0

下载


Notebook

Abstract :

A container image of jupyter notebook development environment with anaconda3, some other runtimes and packages.

Runtimes :

  • python3 (Anaconda3-2020.11)
  • python2
  • octave
  • c

Packages :

  • tensorflow==2.4.0
  • pytorch==1.7.0
  • pyspark==2.4.5
  • pyod==0.7.5

Quick start :

  1. cd /path/to/your/directory/
  2. docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook
  3. # Then Open your browser with url `<ip>:8888` for notebook
  4. # or url `<ip>:8888/lab` for lab.

Usage :

  1. GET IMAGE (Optional, but suggested)

    1. docker pull mooyxu/notebook
  2. ALIAS (Optional, but suggested)

    • LINUX

      1. echo alias notebook=\''docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook'\' >> ~/.bashrc
      2. source ~/.bashrc
    • or MAC

      1. echo alias notebook=\''docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook'\' >> ~/.bash_profile
      2. source ~/.bash_profile
  3. RUN

    • WITHOUT PASSWORD

      1. cd /path/to/your/directory/
      2. notebook
      3. # Depend on step 2, otherwise use command 'docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook'.
    • or WITH PASSWORD

      1. docker run -it --rm mooyxu/notebook python -c 'from notebook.auth import passwd; print(passwd())' # Input PASSWORD, copy OUTPUT, then paste it below
      2. cd /path/to/your/directory/
      3. notebook /bin/bash /opt/run.sh '<OUTPUT>' # [EXAMPLE] notebook /bin/bash /opt/run.sh 'a1b2c3'
      4. # Depend on step 2, otherwise use command: docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook /bin/bash /opt/run.sh '<OUTPUT>'.
  4. USE

    Open your browser with url <ip>:8888 for notebook

    or url <ip>:8888/lab for lab.

  5. STOP

    1. docker stop notebook
  6. REMOVE

    1. docker rmi mooyxu/notebook \
    2. | docker images | grep mooyxu/notebook | awk '{print $3}' \
    3. | xargs docker rmi \
    4. && sed -i '/mooyxu\/notebook/d' ~/.bashrc # or MAC: instead of '~/.bash_profile'

ADVANCED :

  1. BUILD

    1. docker build -t mooyxu/notebook .
    2. # Suggested in linux: docker build -t mooyxu/notebook -t mooyxu/notebook:`date -I` .
  2. DEBUG

    1. docker run -it --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook bash
    2. jupyter notebook
    3. # Then you will get one or two images: mooyxu/notebook:latest and mooyxu/notebook:<date_of_today>
  3. TEST tensorflow

    1. import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([5000, 5000])))
  4. TEST pytorch

    1. from __future__ import print_function
    2. import torch
    3. x = torch.rand(5, 3)
    4. print(x)
  5. QUICK commands

    1. alias pip='docker exec -it notebook pip'
    2. alias ipython='docker exec -it notebook ipython'
    3. alias pyspark='docker exec -it notebook pyspark'
    4. alias java='docker exec -it notebook java'
    5. # alias octave='docker exec -it notebook octave'

Contact :

Email: xumengyu2008@qq.com