第一步:启动ubuntu安装docker
root@lyf-virtual-machine:~# apt-get install docker.io
第二步:
root@lyf-virtual-machine:~#sudo apt-get install apparmor
第三步:打开docker
root@lyf-virtual-machine:~# sudo service docker start
root@lyf-virtual-machine:~# docker ps
//列出当前所以运行的container
第四步:
root@lyf-virtual-machine:/home/lyf/liyongfen# docker load -i caffe-cpu-master.image.tar
//先复制caffe-cpu-master.image.tar到自己的目录下(liyongfen)
root@lyf-virtual-machine:/home/lyf/liyongfen# docker images
//将列出所有的容器镜像
第五步:
root@lyf-virtual-machine:/home/lyf/liyongfen# docker run -itd -p 2012:22 --name=lyf_caffe --hostname=LYF-CAFFE --privileged xd/caffe-cpu-master
第六步:
root@lyf-virtual-machine:/home/lyf/liyongfen# docker start lyf_caffe
root@lyf-virtual-machine:/home/lyf/liyongfen# docker exec -it lyf_caffe /bin/bash
root@LYF-CAFFE:/# /etc/init.d/ssh start
第八步:第一次要设置密码
root@LYF-CAFFE:/# passwd
root@LYF-CAFFE:/# rm -rf caffe/
root@LYF-CAFFE:/# cd opt
root@LYF-CAFFE:/opt# tar xvf caffe.tar
要首先复制caffe.tar到opt文件下面
第九步:
编译:
cp Makefile.config.example Makefile.config (修改只让cpu跑)opt/caffe
# Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired)
make all
make test
make runtest
mkdir build
cd build
cmake ..
make all
make install
make runtest