写Dockerfile
参见https://www.jianshu.com/p/35b6aebe3408
docker build -t image_name:image_version .
其他命令
docker pull image_name:image_version
docker run -it -v /home/lim:/lim -p 1000:1000 --name lim_container image_name:image_version
nvidia-docker run -it -v /home/lim:/lim -p 1000:1000 --name lim_container image_name:image_version
NV_GPU=0 nvidia-docker run -it -v /home/lim:/lim -p 1000:1000 --name lim_container image_name:image_version /bin/bash # 限定使用的GPU
exit
docker start container_name
docker stop container_name
dokcer rm container_name
docker rmi image_name:image_version
docker container ls
docker images
docker commit -a "lim" -m "lim's image" container_name iamge_name:image_version # 将当前container打包成image
参考:https://www.runoob.com/docker/docker-command-manual.html
GPU开发环境
docker pull image_name:image_version
NV_GPU=0 nvidia-docker run -it -v /home/lim:/lim -p 1000:1000 --name lim_container image_name:image_version /bin/bash # 限定使用的GPU
exit
docker start container_name
docker exec -it container_name /bin/bash