Docker

2018年3月29日 (四) 07:57Luxin433讨论 | 贡献的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Tensorflow Docker教学镜像使用流程

安装Docker Engine

1. 下载Docker CE版本, 并安装

https://www.docker.com/community-edition

2. 拉我们制作的Tensorflow镜像

git clone http://gitlab.icenter.tsinghua.edu.cn/luxin433/tfCourse-docker.git

3. 按照仓库里的README文件, build镜像, 运行container即可.

构建加载镜像

Build the docker image

docker build -t $(cat VERSIONS) . 

or you can load the built local image.

 docker load -i tf.tar 

Run the docker image

docker run -dit -p 8889:8889 $(cat VERSIONS) 

Enter the docker image

docker exec -it $CONTAINER\_ID bash

或者用以下命令直接进入最新的一个container

docker exec -it $(docker ps | head -2 | tail -1 | awk '{print $1}') bash

Feature

  • Debian 9
  • Python 3.6.4 :: Anaconda, Inc.
  • conda 4.4.10
  • tensorboard (1.6.0)
  • tensorflow (1.6.0)
  • git-prompt, git-completion, git shortcut
  • Tunet


FAQ

1. win10 home版本无法安装CE

   * 安装Docker Toolbox即可

2. Docker toolbox terminal 启动的时候报错`Intel VT and AMD-V virtualization`

   * 需要在BIOS中打开虚拟化设置|

3. Chrome浏览器无法访问6006端口?

如果你用的是DockerToolbox也就是VirtualBox方案, 实际上我们有三层虚拟机, VirutalBox -> Docker Engine -> Docker Container. 
我们前面只设置了Docker Engine -> Container的端口映射, 所以还要设置主机到VirtualBox的映射. 设置方法是打开VirtualBox设置如下图所示

Virtualbox-mapping.jpg


4. C盘磁盘空间不够

   * 更换虚拟机磁盘位置, 删除C盘旧的虚拟机. 去D盘, 执行`docker-machine -s $FOLDER $虚拟机名字 -d virtualbox`即可创建新的虚拟机. 
   * 执行`docker-machine ls`可查看已有虚拟机.
   * 执行`docker-machine env $虚拟机名字`可查看如何连接虚拟机.按输出要求执行即可.
最后修改于2018年3月29日 (星期四) 07:57