docker pull [OPTIONS] NAME[:TAG|@DIGEST]
# eg:
docker pull nvcr.io/nvidia/pytorch:20.06-py3
docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
# eg:
docker run --gpus all -ti -v /:/data --ipc=host -p 8000:8000 --name lufficc nvcr.io/nvidia/pytorch:20.03-py3
-it
交互模式运行--rm
容器退出时自动删除此容器-v
绑定磁盘,/:/data
即将容器下 /data
目录映射到主服务器的 /
目录--ipc
IPC mode-p
映射端口--name
容器名称docker start [OPTIONS] CONTAINER [CONTAINER...]
# eg:
docker start lufficc
docker stop [OPTIONS] CONTAINER [CONTAINER...]
# eg:
docker stop lufficc
docker container ls -a
docker exec -it CONTAINER bash
# 如果使用 zsh
docker exec -it CONTAINER zsh
docker rm CONTAINER
docker rmi IMAGE