1. docker version 显示docker的版本信息
2. docker info 显示docker的系统信息,包括镜像和容器的数量
3. docker --help 帮助命令
镜像命令
一、 docker images 显示镜像 docker --help 帮助手册
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest feb5d9fea6a5 7 months ago 13.3kB
ubuntu 15.10 9b9cb95443b5 5 years ago 137MB
[root@localhost ~]#
# 解释
REPOSITORY 镜像的仓库源
TAG 镜像的标签
IMAGE ID 镜像的id
CREATED 镜像的创建时间
SIZE 镜像的大小
#可选项
-a, --all #列出所有镜像
-q, --quiet #只显示镜像的id
例:docker images -aq 只显示所有的镜像
二、 docker search 搜索镜像 docker search --help 帮助手册
[root@localhost ~]# docker search mysql
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 12453 [OK]
mariadb MariaDB Server is a high performing open sou… 4800 [OK]
#可选项 通过搜藏来过滤
--filter=stars=3000 搜索出来的镜像stars大于3000
例:
[root@localhost ~]# docker search mysql --filter=stars=3000
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
mysql MySQL is a widely used, open-source relation… 12453 [OK]
mariadb MariaDB Server is a high performing open sou… 4800 [OK]
[root@localhost ~]#
三、docker pull 下载镜像
#下载镜像 docker pull 镜像名 [:tag]
[root@localhost ~]# docker pull mysql
Using default tag: latest # 如果不写tag 默认就是latest
latest: Pulling from library/mysql
4be315f6562f: Pull complete # 分层下载 docker iamges 的核心 联合文件系统
96e2eb237a1b: Pull complete
8aa3ac85066b: Pull complete
ac7e524f6c89: Pull complete
f6a88631064f: Pull complete
15bb3ec3ff50: Pull complete
ae65dc337dcb: Pull complete
654aa78d12d6: Pull complete
6dd1a07a253d: Downloading 106.3MB/107.8MB
a32905dc9e58: Download complete
152d41026e44: Download complete
42e0f73ebe32: Download complete
Digest : sha256:dc255ca50a42b3589197000b # 签名地址
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest #真实地址
#等价于它
docker pull mysql
docker pull docker.io/library/mysql:latest
#指定版本下载
docker pull mysql:5.7
四、docker rmi 删除镜像
#根据image ID 删除
docker rmi -f 9b9cb95443b5 #删除指定的容器
docker rmi -f 容器id 容器 id 容器 id #加空格删除多个容器
docekr rmi -f $(docker images -aq) #删除全部的容器