docker pull 详解

docker pull 用于从镜像仓库中拉取或更新指定镜像,用法如:docker pull centos ,默认是从 Docker Hub 中拉取镜像

在拉取镜像前,我们可以先配置 docker 加速器,以便提高拉取速度,配置如下:

[root@localhost ~]$ vim /etc/docker/daemon.json                   # 这个文件默认是不存在的,需要自行添加,这个文件是docker的默认配置文件,/etc/docker/daemon.json 详解
{                                                             
  "registry-mirrors": ["https://dhq9bx4f.mirror.aliyumcs.com"]    # 这个url是加速器地址,我们可以自行去阿里云申请一个加速器,这里我们可以用别人的
}
[root@localhost ~]$ systemctl restart docker                      # 配置完记得重启docker

docker pull 输出信息:

[root@localhost ~]$ docker pull centos
Using default tag: latest
latest: Pulling from library/centos
a02a4930cb5d: Pull complete 
Digest: sha256:184e5f35598e333bfa7de10d8fb1cebb5ee4df5bc0f970bf2b1e7c7345136426
Status: Downloaded newer image for centos:latest

 

 

 

 

     

posted @ 2018-12-26 16:59  孔雀东南飞  阅读(5242)  评论(0编辑  收藏  举报