您当前的位置: 首页 >  docker

小志的博客

暂无认证

  • 1浏览

    0关注

    1217博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Docker 镜像命令

小志的博客 发布时间:2019-07-03 16:03:12 ,浏览量:1

一、列出本地主机上的镜像命令

1、列出本地主机上的镜像命令: docker images

[root@localhost ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
rtdbinterface       latest              5f30db405001        4 weeks ago         261MB
hello-world         latest              fce289e99eb9        6 months ago        1.84kB
[root@localhost ~]# 

2、列出本地所有的镜像(含中间映像层)命令:docker images -a

[root@localhost ~]# docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
rtdbinterface       latest              5f30db405001        4 weeks ago         261MB
hello-world         latest              fce289e99eb9        6 months ago        1.84kB
[root@localhost ~]# 

3、列出本地所有的镜像,只显示镜像ID的命令:docker images -q

[root@localhost ~]# docker images -q
5f30db405001
fce289e99eb9
[root@localhost ~]#

4、列出本地所有的镜像,显示镜像的摘要信息的命令:docker images --digests

[root@localhost ~]# docker images --digests
REPOSITORY          TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
rtdbinterface       latest                                                                                  5f30db405001        4 weeks ago         261MB
hello-world         latest              sha256:0e11c388b664df8a27a901dce21eb89f11d8292f7fca1b3e3c4321bf7897bffe   fce289e99eb9        6 months ago        1.84kB

5、列出本地所有的镜像,显示完整的镜像信息的命令:docker images --no-trunc

[root@localhost ~]# docker images --no-trunc
REPOSITORY          TAG                 IMAGE ID                                                                  CREATED             SIZE
rtdbinterface       latest              sha256:5f30db405001dda9e8908fec8e2741deafe72d81751a1ce1bce964e5a54169a5   4 weeks ago         261MB
hello-world         latest              sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e   6 months ago        1.84kB

二、查找镜像命令

1、查询某个镜像的命令:docker search 某个XXX镜像名字

[root@localhost ~]# docker search tomcat

在这里插入图片描述2、列出收藏数不小于指定值的镜像命令:docker search -s 30 某个XXX镜像名字

[root@localhost ~]# docker search -s 30 tomcat

在这里插入图片描述3、列出收藏数不小于指定值的镜像,并显示完整的镜像描述命令:docker search -s 30 --no-trunc 某个XXX镜像名字

[root@localhost ~]# docker search -s 30 --no-trunc tomcat

在这里插入图片描述 三、下载镜像命令

1、下载镜像命令:docker pull 某个XXX镜像名字

[root@localhost ~]# docker pull tomcat

在这里插入图片描述 四、删除镜像命令:

1、删除单个镜像的命令:docker rmi -f 镜像ID

[root@localhost ~]# docker rmi  -f hello-world

在这里插入图片描述 2、删除多个镜像的命令 docker rmi -f 镜像名1:TAG 镜像名2:TAG

[root@localhost ~]# docker rmi  -f hello-world nginx

在这里插入图片描述 3、删除全部镜像的命令:docker rmi -f $(docker images -qa)

关注
打赏
1661269038
查看更多评论
立即登录/注册

微信扫码登录

0.0433s