docker镜像常见命令
1,docker images //查看镜像
[root@CentOS7.4-1 ~]#docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 4 months ago 13.3kB
[root@CentOS7.4-1 ~]#docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 4 months ago 13.3kB
[root@CentOS7.4-1 ~]#docker images -q
bf756fb1ae65
[root@CentOS7.4-1 ~]#docker images -qa
bf756fb1ae65
[root@CentOS7.4-1 ~]#docker images --digests
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
hello-world latest sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1 bf756fb1ae65 4 months ago 13.3kB
[root@CentOS7.4-1 ~]#docker images --digests --no-trunc
REPOSITORY TAG DIGEST IMAGE ID CREATED SIZE
hello-world latest sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1 sha256:bf756fb1ae65adf866bd8c456593cd24beb6a0a061dedf42b26a993176745f6b 4 months ago 13.3kB
[root@CentOS7.4-1 ~]#
说明:
2,docker search //搜索镜像
[root@CentOS7.4-1 ~]#docker search tomcat
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
tomcat Apache Tomcat is an open source implementati… 2739 [OK]
tomee Apache TomEE is an all-Apache Java EE certif… 79 [OK]
dordoka/tomcat Ubuntu 14.04, Oracle JDK 8 and Tomcat 8 base… 54 [OK]
bitnami/tomcat Bitnami Tomcat Docker Image 33 [OK]
kubeguide/tomcat-app Tomcat image for Chapter 1 28
consol/tomcat-7.0 Tomcat 7.0.57, 8080, "admin/admin" 17 [OK]
cloudesire/tomcat Tomcat server, 6/7/8 15 [OK]
aallam/tomcat-mysql Debian, Oracle JDK, Tomcat & MySQL 12 [OK]
arm32v7/tomcat Apache Tomcat is an open source implementati… 10
rightctrl/tomcat CentOS , Oracle Java, tomcat application ssl… 6 [OK]
maluuba/tomcat7-java8 Tomcat7 with java8. 5
unidata/tomcat-docker Security-hardened Tomcat Docker container. 4 [OK]
amd64/tomcat Apache Tomcat is an open source implementati… 2
jelastic/tomcat An image of the Tomcat Java application serv… 2
arm64v8/tomcat Apache Tomcat is an open source implementati… 2
oobsri/tomcat8 Testing CI Jobs with different names. 1
i386/tomcat Apache Tomcat is an open source implementati… 1
camptocamp/tomcat-logback Docker image for tomcat with logback integra… 1 [OK]
99taxis/tomcat7 Tomcat7 1 [OK]
ppc64le/tomcat Apache Tomcat is an open source implementati… 1
cfje/tomcat-resource Tomcat Concourse Resource 0
picoded/tomcat7 tomcat7 with jre8 and MANAGER_USER / MANAGER… 0 [OK]
secoresearch/tomcat-varnish Tomcat and Varnish 5.0 0 [OK]
appsvc/tomcat 0
s390x/tomcat Apache Tomcat is an open source implementati… 0
[root@CentOS7.4-1 ~]#
[root@CentOS7.4-1 ~]#docker search --filter=stars=30 --no-trunc tomcat
Error response from daemon: Get https://index.docker.io/v1/search?q=tomcat&n=25: net/http: TLS handshake timeout
[root@CentOS7.4-1 ~]#
3,docker pull //拉取镜像
[root@CentOS7.4-1 ~]#docker pull redis //等价于 docker pull redis:latest,因为不加版本号的话,默认就是拉取最新的镜像
Using default tag: latest
latest: Pulling from library/redis
afb6ec6fdc1c: Pulling fs layer
608641ee4c3f: Pulling fs layer
668ab9e1f4bc: Pulling fs layer
ea9ab8bf5f73: Waiting
137e0d1a14d9: Waiting
b2c5e1be4a59: Waiting
4,docker rmi //删除镜像
[root@CentOS7.4-1 yum.repos.d]#docker rmi hello-world //删除一个
[root@CentOS7.4-1 yum.repos.d]#docker rmi hello-world nginx //删除多个
[root@CentOS7.4-1 yum.repos.d]#docker rmi -f $(docker images -qa) //删除全部