docker免sudo
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart
newgrp - docker
If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvid
查找含有某段内容的文件
find ./ -name ‘*’|xargs grep ‘/home/robot/.conda/envs/theano’
解决:将docker run换成nvidia-docker run
docker run --name cpp_refactoring --privileged=true -d -t -i -p 10022:22 -p 8089:8089 --entrypoint “/bin/bash” --rm -v /opt/cppview/project:/opt/build -v /opt/cppview/environment:/usr1/cppview:rw --workdir=/usr1/cppview cpp_refactoring:v2
使用10022直接连接到docker容器