在度娘了1周的Python安装方案(windows 安装anaconda3、vmware安装linux再安装anaconda3、docker tools安装continuumio/anaconda3)后,最后决定采用continuumio/anaconda3 的docker image。好处是不需要考虑各种环境问题,直接用docker。
安装过程如下:
1、安装docker toolbox for windows7
从阿里云下载DockerToolbox-17.10.0-ce.exe,安装。
2、创建docker Machine
用git bash工具,启动git-bash,修改缺省的docker-machine的存储位置,
notepad .bash_profile
增加如下语句
export MACHINE_STORAGE_PATH='D:\docker'
开始创建docker machine,-s 指定存储位置, --engine-registry-mirror 指定镜像位置,此次用docker-cn的加速器,命名为default。
docker-machine -s "D:\docker" create --engine-registry-mirror=https://registry.docker-cn.com -d virtualbox default
3、运行docker
用putty登录docker machine。(username=docker,passwd=tcuser),运行:
docker run -i -p 8888:8888 registry.docker-cn.com/
continuumio/anaconda3 /bin/bash -c "/opt/conda/bin/conda install jup
yter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter no
tebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-brows
er --allow-root"
可以用token在HOST上登录jupyter notebook了。