码迷,mamicode.com
首页 > 其他好文 > 详细

docker镜像命令

时间:2020-02-06 19:33:28      阅读:71      评论:0      收藏:0      [点我收藏+]

标签:不同的   world   size   多个   创建时间   hello   点赞   ges   images   

列出本地的镜像

docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
nginx               latest              540a289bab6c        4 weeks ago         126MB
tomcat              latest              882487b8be1d        4 weeks ago         507MB
centos              latest              0f3e07c0138f        7 weeks ago         220MB
hello-world         latest              fce289e99eb9        10 months ago       1.84kB

详解

REPOSITORY: 表示镜像的仓库源
TAG: 镜像的标签
IMAGE ID: 镜像ID
CREATED: 镜像创建时间
SIZE: 镜像大小

同一个仓库可以有多个tag,代表这个仓库源的不同版本,我们使用REPOSITORY:TAG来定义不同的镜像

如果不指定镜像的版本标签,默认使用最新版本的
例如,ubuntu默认使用ubuntu:latest镜像

options

-a: 列出本地所有的镜像(含中间映像层)
-q: 只显示镜像ID
--digests: 显示镜像的摘要信息
--no-trunc: 显示完整的镜像信息

从docker hub查找镜像

docker search [OPTIONS]

docker search -s 30 tomcat  查找点赞数大于30的tomcat镜像

--no-trunc: 显示完整的镜像描述
--automated: 只列出automated build类型的镜像

拉取镜像

docker pull 镜像名字

删除镜像

docker rmi 镜像名字或者镜像ID

删除单个镜像options

docker rmi tomcat  删除tomcat
docker rmi -f tomcat  强制删除tomcat

删除多个镜像

docker rmi -f tomcat hello-world

镜像中间以空格隔开

删除全部镜像

docker rmi -f $(docker images -qa)

docker镜像命令

标签:不同的   world   size   多个   创建时间   hello   点赞   ges   images   

原文地址:https://www.cnblogs.com/eternityz/p/12269794.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!