版本信息
docker version #版本信息docker info #docker 命令 --help帮助文档https://docs.docker.com/reference/
查看本机所有镜像
docker images
[root@iZbp1d0213clo5fn6z0fsfZ ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEjenkins/jenkins latest ce038d88aadd 4 weeks ago 580MBmysql 8 0627ec6901db 5 weeks ago 556MBhello-world latest d1165f221234 2 months ago 13.3kB#解释REPOSITORY 镜像的仓库源TAG 镜像的标签IMAGE ID 镜像的idCREATED 镜像的创建时间SIZE 镜像的大小# 可选项-a , --all # 列出所有的镜像-q, --quiet # 只显示镜像的id
搜索命令
docker search
[root@iZbp1d0213clo5fn6z0fsfZ ~]# docker search mysqlNAME DESCRIPTION STARS OFFICIAL AUTOMATEDmysql MySQL is a widely used, open-source relation… 10932 [OK]mariadb MariaDB Server is a high performing open sou… 4134 [OK]# 可选项 通过搜索来过滤--fliter=STARS=3000 #搜索出来的STARS是3000以上的
下载镜像
docker pull 镜像名 [:tag]版本
docker pull 镜像名 [:tag]版本[root@iZbp1d0213clo5fn6z0fsfZ ~]# docker pull mysqlUsing default tag: latest # 如果不写 tag. 默认就是 latestlatest: Pulling from library/mysql69692152171a: Pull complete # 分层下载, docker iamge的核心 联合文件系统1651b0be3df3: Pull complete951da7386bc8: Pull complete0f86c95aa242: Pull complete37ba2d8bd4fe: Pull complete6d278bb05e94: Pull complete497efbd93a3e: Pull completef7fddf10c2c2: Pull complete16415d159dfb: Pull complete0e530ffc6b73: Pull completeb0a4a1a77178: Pull completecd90f92aa9ef: Pull completeDigest: sha256:d50098d7fcb25b1fcb24e2d3247cae3fc55815d64fec640dc395840f8fa80969 # 签名Status: Downloaded newer image for mysql:latestdocker.io/library/mysql:latest # 真是地址#等价于docker pull mysqldocker pull docker.io/library/mysql:latest
删除镜像
docker rmi -f 镜像id
# 删除镜像docker rmi -f 根据id删除# 批量删除 所有容器docker rmi -f $(docker images -aq) # 通过查出id批量删除
