View image information

 1. Use mirror images command to list

    Use docker images or docker image ls command lists the basic information on the local host has been mirrored, including warehouses, labels, image ID, creation time, image size and other information

     Wherein the image ID is important, that uniquely identifies the image, it may be generally the first several characters of the string can be distinguished instead of the full ID

     Image size information indicates only the size of the logical volume of the mirror, in fact, only the same as the local storage of a mirror layer, the physical storage space occupied by each of the mirrored logical volume will be less than the sum.

    The main sub-images command supports the following options, you can try yourself:

      -a, -all = true | false: List all (including temporary files) Mirror, default is no;

      --digests = true | false: the value of listed digital abstract image, the default is no;

      -f, - filter = []: Mirror filtered listed, such as dangling = true not only display mirror being used; the mirror can also be specified with a special label, and the like;

      --format = "TEMPLATE": control the output format, such as ID information on behalf .ID, .Repostory information representative of the warehouse;

      --no-trunc = true | false: the output result of long whether truncated portion, such as the image ID information, a default;

      -q, - quiet = true | false: output only ID information, the default is NO.

    More sub-command can be viewed by man docker-images.

  2. Use the tag command to add a mirror tag

    In order to facilitate the use of a specific image in a subsequent operation, you may also be used for a local docker tag command to add any new label image. E.g

      docker tag ubuntu:latest myubuntu:latest

      After it can be used directly myubuntu: latest to represent the image, and its original ububtu: latest pointing to the same image file, docker tag command to add labels actually played a similar role in the link.

  3. Use the inspect command to view details

    Use docker [image] inspect command to obtain details of the mirror, including the producer to adapt to the architecture, like digital abstract layers:

      docker [image] inspect ubuntu:18.04

      The above is a return code message JSON format, if we just one content, it is possible to specify the -f, e.g., fetching an image of Architecture:

      docker [image] inspect -f {{".Architecture"}}  ubuntu:18.04

  4. Use the history command to view mirror of history

    You can use history sub-command, which lists the information to create the layers

    docker history ubuntu:18.04

    Note: The command is automatically cut off too long, you can use the --no-trunc option mentioned earlier to complete the command output.      

Guess you like

Origin www.cnblogs.com/weisunblog/p/12221710.html