1、docker images :查看所有本地主机上的镜像
[root@ /]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest d1165f221234 3 weeks ago 13.3kBREPOSITORY:镜像的仓库源
TAG:版本标签信息
IMAGE ID:镜像的ID
CREATED:镜像的创建时间
SIZE :镜像的大小
docker images --help 查看docker images帮助文档
可选项:
-a, --all 列出所有的镜像
-q, --quiet 只显示镜像的Id
2、docker search:搜索镜像
[root@ /]# docker search mysql #搜索mysql镜像
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10671 [OK]
mariadb MariaDB Server is a high performing open sou… 4008 [OK]
mysql/mysql-server Optimized MySQL Server Docker images. Create… 779 [OK]
percona Percona Server is a fork of the MySQL relati… 528 [OK]
centos/mysql-57-centos7 MySQL 5.7 SQL database server 87
mysql/mysql-cluster Experimental MySQL Cluster Docker images. Cr… 80
centurylink/mysql Image containing mysql. Optimized to be link… 59 [OK]
bitnami/mysql Bitnami MySQL Docker Image 50 [OK]
databack/mysql-backup Back up mysql databases to... anywhere! 42
deitch/mysql-backup REPLACED! Please use http://hub.docker.com/r… 41 [OK]
prom/mysqld-exporter 37 [OK]
tutum/mysql Base docker image to run a MySQL database se… 35
schickling/mysql-backup-s3 Backup MySQL to S3 (supports periodic backup… 29 [OK]
linuxserver/mysql A Mysql container, brought to you by LinuxSe… 27
centos/mysql-56-centos7 MySQL 5.6 SQL database server 20
circleci/mysql MySQL is a widely used, open-source relation… 20
mysql/mysql-router MySQL Router provides transparent routing be… 18
arey/mysql-client Run a MySQL client from a docker container 17 [OK]
fradelg/mysql-cron-backup MySQL/MariaDB database backup using cron tas… 12 [OK]
yloeffler/mysql-backup This image runs mysqldump to backup data usi… 7 [OK]
openshift/mysql-55-centos7 DEPRECATED: A Centos7 based MySQL v5.5 image… 6
devilbox/mysql Retagged MySQL, MariaDB and PerconaDB offici… 3
ansibleplaybookbundle/mysql-apb An APB which deploys RHSCL MySQL 2 [OK]
jelastic/mysql An image of the MySQL database server mainta… 1
widdpim/mysql-client Dockerized MySQL Client (5.7) including Curl… 1 [OK]
Options:
-f, --filter filter #通过过滤来搜索
--format string
--limit int
--no-trunc[root@ /]# docker search mysql --filter=STARS=3000 #搜索3000以上的
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 10671 [OK]
mariadb MariaDB Server is a high performing open sou… 4008 [OK]
3、docker pull 镜像名[:tap]:下载镜像,如果不加版本号,就下载最新版
[root@ /]# docker pull mysql:5.7
5.7: Pulling from library/mysql
a076a628af6f: Pull complete
f6c208f3f991: Pull complete
88a9455a9165: Pull complete
406c9b8427c6: Pull complete
7c88599c0b25: Pull complete
25b5c6debdaf: Pull complete
43a5816f1617: Pull complete
1831ac1245f4: Pull complete
37677b8c1f79: Pull complete
27e4ac3b0f6e: Pull complete
7227baa8c445: Pull complete
Digest: sha256:b3d1eff023f698cd433695c9506171f0d08a8f92a0c8063c1a4d9db9a55808df
Status: Downloaded newer image for mysql:5.7
docker.io/library/mysql:5.7
4、docker rmi -f 镜像Id: 通过镜像id删除镜像
docker rmi -f $(docker images -aq) :删除全部容器