zoukankan      html  css  js  c++  java
  • docker镜像命令

    列出本地的镜像

    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)
    
  • 相关阅读:
    237. 删除链表中的节点
    牛客网-第一场-J-Fraction Comparision
    1. 两数之和
    CCF-201903-1大中小
    学习Python
    Convert Sorted Array to Binary Search Tree
    3-1
    Merge Sorted Array
    Climbing Stairs
    Add Binary
  • 原文地址:https://www.cnblogs.com/eternityz/p/12269794.html
Copyright © 2011-2022 走看看