1.怎么给运行中的docker容器添加新的端口
解决:
http://blog.csdn.net/zuoshenglo/article/details/78402772
(1)获得容器IP:docker inspect `container_name` | grep IPAddress)
(2)iptable端口转发(将容器的8000端口映射到主机的8001端口):iptables-t nat -A DOCKER -p tcp --dport8001-j DNAT --to-destination172.17.0.19:8000
2.
nvidia-docker ps 查看现有活着的的docker
nvidia-docker ps -a 查看所有的docker
3.nvidia-docker run -v /home/Alice/:/home/Alice/ -tdi bvlc/caffe:gpu 将本地的Alice文件夹在docker中映射为Alice
4.修改映射端口号
jupyter notebook --generate-config
vim jupyter_notebook_config.py
c.NotebookApp.port = 8888 #8888修改
5.docker下使用gdb调试程序
apt-get install gdb
nvidia-docker commit 39cc795376ab mtcnn/caffe:gpu
(gdb) set args /home/rentingting/project/mtcnn/MTCNN_Caffe/examples/MTmodel /home/rentingting/project/mtcnn/MTCNN_Caffe/examples/MTSrc/test2.jpg
(gdb) set args/home/rentingting/project/mtcnn/MTCNN_Caffe/examples/MTmodel /home/rentingting/project/mtcnn/MTCNN_Caffe/examples/MTSrc/test2.jpg
nvidia-docker run --privileged -it -v /home/rentingting/:/home/rentingting/ mtcnn/caffe:gpu /bin/bash