提要: 记录手动搭建GPU版PyTorch Docker镜像的过程。本地主机已经装好了显卡驱动,CUDA, cuDNN, 因此不再累述。本篇博客覆盖以下内容:
- Docker常用命令
- 搭建GPU版PyTorch镜像
Docker常用命令
- ubuntu安装步骤
$ apt-get update
$ apt-get -y install docker.io
# 检查Docker服务的状态
$ service docker.io status
# 一般显示 docker.io start/running, process xxxxx
#
# 把Docker安装为自启动服务,让它随服务器的启动而自动运行
update-rc.d docker.io defaults
#
# 测试Docker安装成功
docker run hello-world
# 如果本地没有hello-world镜像,会自动拉去一个
- Docker常用命令
### 显示版本信息 (与python, nvcc相比少了两个‘--’)
$ docker version
### 了解当前Docker的使用状态(当前容器,镜像数目信息,存储空间占用信息,
# OS内核版本, 发行版本, 硬件资源等)
$ docker info
### 拉去一个镜像 ( xxxx 表示某个镜像名字,)
$ docker pull xxxx
# e.g.
# docker pull ubuntu
### 查看系统中已有的镜像(images要带‘s')
$ docker images
# e.g.:
# REPOSITORY TAG IMAGES ID CREATED VIRTUAL SIZE