03-1 docker镜像管理之镜像的搜索、查看、获取
03-1 docker镜像管理之镜像的搜索、查看、获取
-
搜索镜像:
docker search [镜像名称]
#作用:搜索Docker Hub(镜像仓库)上的镜像 #命令格式: docker search [镜像名称] #命令演示: qwe@ubuntu:~$ docker search hyperledger NAME DESCRIPTION STARS OFFICIAL AUTOMATED hyperledger/fabric-peer Fabric Peer docker image for Hyperledger Pro… 171 hyperledger/fabric-ca Fabric CA 54 hyperledger/fabric-baseimage 52 hyperledger/fabric-orderer 49 hyperledger/fabric-couchdb Fabric Couchdb docker image for Hyperledger … 38 hyperledger/fabric-tools 33 hyperledger/fabric-membersrvc Fabric Member Service docker image for Hyper… 31 hyperledger/fabric-ccenv Fabric chaincode environment 25 hyperledger/fabric-kafka Fabric Kafka docker image for Hyperledger Pr… 20 hyperledger/fabric-baseos Fabric base OS 19 hyperledger/fabric-zookeeper Fabric Zookeeper docker image for Hyperledge… 15 yeasy/hyperledger Docker image for hyperledger 13 [OK] yeasy/hyperledger-fabric Docker image for Hyperledger Fabric. 12 [OK] hyperledger/sawtooth-validator An image with the Sawtooth Lake Validator an… 10 hyperledger/explorer Hyperledger Explorer is a blockchain module … 8 hyperledger/iroha Hyperledger Iroha is an efficient and easy-t… 8 yeasy/hyperledger-fabric-peer Docker image for Hyperledger Fabric Peer 7 [OK] yeasy/hyperledger-fabric-base Docker image for hyperledger fabric base. 6 [OK] hyperledger/sawtooth-settings-tp Sawtooth Settings Transaction Processor 4 hyperledger/sawtooth-rest-api Sawtooth REST API 3 hyperledger/besu Hyperledger Besu 3 yeasy/hyperledger-fabric-orderer Docker image for Hyperledger Fabric Orderer 3 [OK] hyperledger/burrow Hyperledger Burrow 3 yeasy/hyperledger-fabric-ca Docker image for Hyperledger fabric-ca. 2 [OK] hyperledger/sawtooth-devmode-engine-rust Sawtooth dev mode: Simple consensus engine f… 0
NAME:名称
DESCRIPTION:基本功能描述
STARS:下载次数
OFFICIAL:官方
AUTOMATED:自动的运行 -
获取镜像
docker pull [镜像名称]
#作用:下载远程仓库(如Docker Hub)中的镜像 #命令格式: docker pull [镜像名称] #命令演示: qwe@ubuntu:~$ docker search caliper NAME DESCRIPTION STARS OFFICIAL AUTOMATED hyperledger/caliper Caliper image for benchmarking blockchain pl… 1 akoita/caliper 0 danielporto/caliper 0 pfgray/caliper 0 [OK] blubber/caliper-docs Caliper documentation 0 [OK] klenik/caliper-fabric-1.4.4 0 mickem/caliper A docker file for caliper 0 pfgray/caliper-with-db A caliper server with a built in couch datab… 0 [OK] glbranimir/caliper-fabric Hyperledger Caliper optimized for testing Fa… 0 klenik/caliper-fabric-1.4.7 0 beelanl/caliper_demo Caliper compiler for BEE interface testing/d… 0 robertdiebels/caliper 0 odowdaibm/caliper 0 klenik/caliper-fabric-2.1.0 0 levanthanh3005/caliper 0 advanca/caliper 0 marcomazzoni/caliper-quorum This is a Caliper image (https://github.com/… 0 dockzhangxj/caliper 0 jorgego/caliper-manager-1017 caliper 3.0.2 image using node v10.17 0 mrihn/caliper 0 russanto/bc-orch-caliper Hyperledger Caliper image containing a devel… 0 mickem/caliper-docker Docker image for running my version of Calip… 0 [OK] # 开始拉取 qwe@ubuntu:~$ docker pull hyperledger/caliper:0.4.0 0.4.0: Pulling from hyperledger/caliper e7c96db7181b: Pull complete 50958466d97a: Downloading [========> ] 3.668MB/21.85MB 56174ae7ed1d: Download complete 284842a36c0d: Pulling fs layer 8fe16129c41a: Waiting 6d9fe8e0cc47: Waiting 5050958466d97a: Downloading 6.646MB/21.85MB 50958466d97a: Pull complete 56174ae7ed1d: Pull complete 284842a36c0d: Pull complete 8fe16129c41a: Pull complete 6d9fe8e0cc47: Pull complete e8065a6f29b6: Pull complete Digest: sha256:7e353e250455385891c07c67de62077d9056b75fae2023602cc39eab00907eb5 Status: Downloaded newer image for hyperledger/caliper:0.4.0 docker.io/hyperledger/caliper:0.4.0
注:获取的镜像在/var/lib/docker 目录下,若想查看,由于权限的原因我们需要切换root用户
#操作下面的文件可以查看相关的镜像信息 :~$ vim /var/lib/docker/image/overlay2/repositories.json
-
查看镜像
docker images [镜像名称]
docker image ls [镜像名称]#作用:列出本地镜像 # docker images为docker image ls的简写,可以跟镜像名称,比如可以搜出Ubuntu的不同版本,命令格式如下 docker images [镜像名称] docker image ls [镜像名称] #命令演示: qwe@ubuntu:~$ docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest d70eaf7277ea 10 days ago 72.9MB hyperledger/caliper 0.4.0 6491b4ec891d 4 weeks ago 356MB hello-world latest bf756fb1ae65 10 months ago 13.3kB # dockers images和docker image ls效果相同 qwe@ubuntu:~$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest d70eaf7277ea 10 days ago 72.9MB hyperledger/caliper 0.4.0 6491b4ec891d 4 weeks ago 356MB hello-world latest bf756fb1ae65 10 months ago 13.3kB #docker images -a 列出所有的本地的images(包括已删除的镜像记录) qwe@ubuntu:~$ docker image ls -a REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest d70eaf7277ea 10 days ago 72.9MB hyperledger/caliper 0.4.0 6491b4ec891d 4 weeks ago 356MB hello-world latest bf756fb1ae65 10 months ago 13.3kB
注:
- REPOSITORY:镜像的名称
- TAG:镜像的版本标签,用来区分不同发行版本,如果不指定具体标记,默认使用latest标记信息
- IMAGE ID:镜像的ID,唯一标识了镜像,如果ID相同,说明是同一镜像。
- CREATED:镜像是什么时候创建的
- SIZE:大小