美文网首页
docker pull

docker pull

作者: 黑客不黑_ | 来源:发表于2019-04-28 14:40 被阅读0次

镜像拉取(下载)
拉取前我们不确定是否存在这个镜像,则可以先到官方镜像仓库https://hub.docker.com
或者国内网易中心仓库https://c.163yun.com/hub#/m/home/
查看是否存在,或者使用docker search查看镜像,确定镜像源和版本则下载镜像到本地。

  • 用法
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
  • 参数
[root@bogon ~]# docker pull --help

Usage:  docker pull [OPTIONS] NAME[:TAG|@DIGEST]

Pull an image or a repository from a registry

Options:
  -a, --all-tags                Download all tagged images in the repository
      --disable-content-trust   Skip image verification (default true)
      --help                    Print usage

Name, shorthand Default Description 中文
--all-tags , -a Download all tagged images in the repository 下载所有版本的镜像
--disable-content-trust true Skip image verification 跳过镜像验证
--platform experimental (daemon)API 1.32+ Set platform if server is multi-platform capable 如果服务器具有多平台功能,则设置平台
  • 示例:
[root@bogon ~]# docker pull busybox
Using default tag: latest
Trying to pull repository docker.io/library/busybox ... 
latest: Pulling from docker.io/library/busybox
fc1a6b909f82: Pull complete 
Digest: sha256:954e1f01e80ce09d0887ff6ea10b13a812cb01932a0781d6b0cc23f743a874fd
Status: Downloaded newer image for docker.io/busybox:latest

下载的镜像可用:docker images 查看。

[root@bogon ~]# docker images
REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE
docker.io/mysql                                 5.7                 2f52e94d8acb        3 days ago          373 MB
docker.io/busybox                               latest              af2f74c517aa        3 weeks ago         1.2 MB
docker.io/debian                                latest              2d337f242f07        4 weeks ago         101 MB
docker.elastic.co/elasticsearch/elasticsearch   6.4.0               1ac676545731        8 months ago        791 MB
quay.io/coreos/etcd                             v3.3.9              58c02f00d03b        9 months ago        39.2 MB
hub.c.163.com/xiaopal/hyperkube                 v1.11.1             9df9e248fcaf        9 months ago        626 MB

删除镜像可用:docker rmi 。

[root@bogon ~]# docker rmi docker.io/debian
Untagged: docker.io/debian:latest
Untagged: docker.io/debian@sha256:724b0fbbda7fda6372ffed586670573c59e07a48c86d606bab05db118abe0ef5
Deleted: sha256:2d337f242f078dfa62c81db584e78e33fd6bf6138875ecfb11fa470f26a5411c
Deleted: sha256:fbb641a8b94349e89886f65d79928e4673530e2a2b4d33c2c95e0426713f78e4
[root@bogon ~]# docker images
REPOSITORY                                      TAG                 IMAGE ID            CREATED             SIZE
docker.io/mysql                                 5.7                 2f52e94d8acb        3 days ago          373 MB
docker.io/busybox                               latest              af2f74c517aa        3 weeks ago         1.2 MB
docker.elastic.co/elasticsearch/elasticsearch   6.4.0               1ac676545731        8 months ago        791 MB
quay.io/coreos/etcd                             v3.3.9              58c02f00d03b        9 months ago        39.2 MB
hub.c.163.com/xiaopal/hyperkube                 v1.11.1             9df9e248fcaf        9 months ago        626 MB

相关文章

网友评论

      本文标题:docker pull

      本文链接:https://www.haomeiwen.com/subject/ymldnqtx.html