如果你還想從頭學起 Docker,可以看看這個系列的文章哦!
https://www.cnblogs.com/poloyy/category/1870863.html
作用
從鏡像倉庫中拉取或更新鏡像
語法格式
docker pull [OPTIONS] NAME[:TAG|@DIGEST]
TAG:標簽,不寫的話默認是 latest 最新版
看看 docker-hub 上的 Tag
options 說明
option | 作用 |
-a, --all-tags | 拉取所有 tagged 鏡像 |
--disable-content-trust | 忽略鏡像的校驗,默認開啟 |
-q, --quiet | 概要輸出 |
--platform string | 若服務支持多平台,這里可以設置平台 |
實際栗子
從 Docker Hub下載java最新版鏡像
docker pull java
從 Docker Hub下載 REPOSITORY 為 java 的所有鏡像
docker pull -a java
下載鏡像的過程
[root@iz2zeak7sgj6i7hrb2g862z ~]# docker pull tomcat:8 8: Pulling from library/tomcat #如果不寫tag,默認就是latest 90fe46dd8199: Already exists #分層下載: docker image 的核心 聯合文件系統 35a4f1977689: Already exists # Alrea exists 表示本地已存在對應的文件,不需要重復下載,提高速度,減少內存占用率 bbc37f14aded: Already exists 74e27dc593d4: Already exists 93a01fbfad7f: Already exists 1478df405869: Pull complete # 本地沒有對應的文件,需要下載,后面再用到該文件的時候就不用再下載了 64f0dd11682b: Pull complete 68ff4e050d11: Pull complete f576086003cf: Pull complete 3b72593ce10e: Pull complete Digest: sha256:0c6234e7ec9d10ab32c06423ab829b32e3183ba5bf2620ee66de866df # 簽名防偽 Status: Downloaded newer image for tomcat:8 docker.io/library/tomcat:8 # 真實地址
等價寫法
docker pull tomcat:8 docker pull docker.io/library/tomcat:8