A container image of jupyter notebook development environment with anaconda3, some other runtimes and packages.
- python3 (Anaconda3-2020.11)
python2octavec
- tensorflow==2.4.0
- pytorch==1.7.0
- pyspark==2.4.5
- pyod==0.7.5
cd /path/to/your/directory/
docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook
# Then Open your browser with url `<ip>:8888` for notebook
# or url `<ip>:8888/lab` for lab.
-
GET IMAGE (Optional, but suggested)
docker pull mooyxu/notebook
-
ALIAS (Optional, but suggested)
-
LINUX
echo alias notebook=\''docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook'\' >> ~/.bashrc source ~/.bashrc
-
or MAC
echo alias notebook=\''docker run -d --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook'\' >> ~/.bash_profile source ~/.bash_profile
-
-
RUN
-
WITHOUT PASSWORD
cd /path/to/your/directory/ notebook # 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
docker run -it --rm mooyxu/notebook python -c 'from notebook.auth import passwd; print(passwd())' # Input PASSWORD, copy OUTPUT, then paste it below cd /path/to/your/directory/ notebook /bin/bash /opt/run.sh '<OUTPUT>' # [EXAMPLE] notebook /bin/bash /opt/run.sh 'a1b2c3' # 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>'.
-
-
USE
Open your browser with url
<ip>:8888
for notebookor url
<ip>:8888/lab
for lab. -
STOP
docker stop notebook
-
REMOVE
docker rmi mooyxu/notebook \ | docker images | grep mooyxu/notebook | awk '{print $3}' \ | xargs docker rmi \ && sed -i '/mooyxu\/notebook/d' ~/.bashrc # or MAC: instead of '~/.bash_profile'
-
BUILD
docker build -t mooyxu/notebook . # Suggested in linux: docker build -t mooyxu/notebook -t mooyxu/notebook:`date -I` .
-
DEBUG
docker run -it --rm -p 8888:8888 --name notebook -v $PWD:/opt/notebooks mooyxu/notebook bash jupyter notebook # Then you will get one or two images: mooyxu/notebook:latest and mooyxu/notebook:<date_of_today>
-
TEST tensorflow
import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([5000, 5000])))
-
TEST pytorch
from __future__ import print_function import torch x = torch.rand(5, 3) print(x)
-
QUICK commands
alias pip='docker exec -it notebook pip' alias ipython='docker exec -it notebook ipython' alias pyspark='docker exec -it notebook pyspark' alias java='docker exec -it notebook java' # alias octave='docker exec -it notebook octave'
Email: xumengyu2008@qq.com