caffe docker部署后安装 jupyter

背景

MAC OS 系统上使用Docker获取 bvlc/caffe:cpu镜像后,发现未安装jupyter工具,手动安装。

  1. 启动容器
    docker run -ti -p 8880:8880 -v /home/:/mnt bvlc/caffe:cpu /bin/bash

  2. 安装、配置jupyter

pip installl jupyter

# 生成jupyter配置文件
jupyter notebook --generate-config
# 修改jupyter配置文件
vim /root/.jupyter/jupyter_notebook_config.py

# 加入下面内容到最下面

# 不自动中启动时打开浏览器
c.NotebookApp.open_browser = False
# 绑定ip
c.NotebookApp.ip = '*'
# 绑定端口
c.NotebookApp.port = 8880
# 默认启动目录
c.NotebookApp.notebook_dir = '/mnt'
#这一步很重要,用于远程打开,不加会出现socket.gaierror: [Errno -2] Name or service not known
错误
c.NotebookApp.allow_remote_access=True
# 然后保存退出

# 设置jupyter密码
jupyter notebook password
#我设置的是 123456
  1. 运行jupyter
jupyter notebook --allow-root
jupyter notebook list
Currently running servers:
http://localhost:8880/ :: /mnt

在本机浏览器 打开 localhost:8880
密码输入 123456
大功告成

你可能感兴趣的:(caffe docker部署后安装 jupyter)