帮助(命令)文档地址: https://docs.docker.com/engine/reference/run/
1.帮助命令
docker version #查看docker版本
docker info #显示docker系统信息,包括镜像和容器的数量
docker --help #帮助命令
2.镜像命令
查看主机上所有镜像
docker images
#REPOSITORY TAG IMAGE ID CREATED SIZE
# REPOSITORY 镜像的仓库源
# TAG 标签
# IMAGE ID 镜像id
# CREATED 镜像创建时间
# SIZE 镜像的大小
查看主机上所有镜像可选项
Options:
-a, --all 列出所有镜像
--digests Show digests
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print images using a Go template
--no-trunc Don't truncate output
-q, --quiet 只显示镜像id
搜索镜像 docker search
docker search --help
Options: #可选项
-f, --filter filter Filter output based on conditions provided
--format string Pretty-print search using a Go template
--limit int Max number of search results (default 25)
--no-trunc Don't truncate output
拉取服务 docker pull
docker pull --help #查看帮助
docker pull mysql #下载mysql默认最新版本
删除镜像 docker rim
docker rmi -f 镜像id #删除指定的镜像
docker rmi -f 镜像id 镜像id 镜像id 镜像id #删除多个镜像
docker rmi -f $(docker images -aq) #删除所有镜像
3.容器命令
有了镜像才可以创建容器,下载centos镜像测试学习
docker pull centos
下载容器并启动