Why the images information provided by docker info is different from docker images

Hi I’m trying to extract the number of docker images I have in my machine

If I run the command docker info it gives me this:

  • Error in gdata::installXLSXsupport() on Docker Centos 7
  • Windows Image on Docker
  • For a web application, does it make sense to have two separate containers for template and api server?
  • How to read and write to mounted volume without running as root?
  • mocha.opts reference babelhook one directory up
  • Writing data to file in Dockerfile
  • Containers: 15
    Images: 27
    Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Dirs: 57
    Username: miggom
    Registry: [https://index.docker.io/v1/]
    WARNING: No swap limit support
    

    If I run the command docker images -a it gives me this:

    REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
    <none>              <none>              2b1cf54887a8        20 minutes ago      139.5 MB
    <none>              <none>              14e148a673c8        3 hours ago         204.4 MB
    <none>              <none>              bf3d7d4f575d        13 days ago         273.9 MB
    <none>              <none>              c3553dd60b1e        13 days ago         273.9 MB
    mgs/my-site         latest              268ffd69fb60        13 days ago         273.9 MB
    miggom/mySite       latest              268ffd69fb60        13 days ago         273.9 MB
    my-site             latest              268ffd69fb60        13 days ago         273.9 MB
    mgsMySite           latest              268ffd69fb60        13 days ago         273.9 MB
    mgs_mySite          latest              268ffd69fb60        13 days ago         273.9 MB
    <none>              <none>              b055dfd3f223        13 days ago         273.9 MB
    apache2             latest              826c4bc6368a        2 weeks ago         273.9 MB
    <none>              <none>              7aa770719eb1        2 weeks ago         273.9 MB
    <none>              <none>              1850570b7316        2 weeks ago         273.9 MB
    <none>              <none>              44943615dd35        2 weeks ago         273.9 MB
    <none>              <none>              994c3e50a608        2 weeks ago         273.9 MB
    <none>              <none>              a97583e98230        2 weeks ago         273.9 MB
    <none>              <none>              635d880c0c38        2 weeks ago         273.9 MB
    <none>              <none>              b8735e7272ef        2 weeks ago         224.3 MB
    baselDaemon         latest              4e892058b0b2        2 weeks ago         204.4 MB
    ubuntu              saucy               9f676bd305a4        4 weeks ago         178 MB
    ubuntu              13.10               9f676bd305a4        4 weeks ago         178 MB
    <none>              <none>              1c7f181e78b9        4 weeks ago         0 B
    ubuntu              13.04               eb601b8965b8        4 weeks ago         166.5 MB
    ubuntu              raring              eb601b8965b8        4 weeks ago         166.5 MB
    <none>              <none>              f323cf34fd77        4 weeks ago         0 B
    ubuntu              12.10               5ac751e8d623        4 weeks ago         161 MB
    ubuntu              quantal             5ac751e8d623        4 weeks ago         161 MB
    <none>              <none>              321f7f4200f4        4 weeks ago         0 B
    ubuntu              10.04               9cc9ea5ea540        4 weeks ago         180.8 MB
    ubuntu              lucid               9cc9ea5ea540        4 weeks ago         180.8 MB
    ubuntu              precise             9cd978db300e        4 weeks ago         204.4 MB
    ubuntu              12.04               9cd978db300e        4 weeks ago         204.4 MB
    ubuntu              latest              9cd978db300e        4 weeks ago         204.4 MB
    <none>              <none>              6170bb7b0ad1        4 weeks ago         0 B
    <none>              <none>              7a4f87241845        5 weeks ago         0 B
    <none>              <none>              511136ea3c5a        8 months ago        0 B
    learn/tutorial      latest              8dbd9e392a96        10 months ago       128 MB
    

    So, the problem is that the number of the images shown in docker info doesn’t match with the number of images shown in docker images. I don’t know how to get the correct number of images beacuse if you also execute the docker images without flags, it doesn’t match with the number of images shown in docker info

    I don’t know which type of information I can get from docker info because in docker.io there is just an example of the documentation.

    Thank you in advance

  • Log level in 0.8.2 not correctly configured?
  • Selenium webdriver with Phantomjs save_screenshot doesn't work in Docker container
  • Dockerized Mongo takes ages to load then doesn't run mongo
  • bamboo agent and docker connectivity, need explanation
  • Error getting response, check your network connection issue with cf ic login command
  • Docker run with “-v” create another shared directory
  • 2 Solutions collect form web for “Why the images information provided by docker info is different from docker images”

    The point here is not whether an image is flagged or not. Take note of the Image ID when you count the images. Several (differently tagged) images with the same ID count as one image, because well… they are the same image 🙂

    If I manually count the different IDs, I find 27.

    A lot of those images are intermediary images and are used for caching when you want to rebuild your Dockerfile.

    By default when you run docker images it hides these intermediate images, but if you pass the -a argument it’ll show them all

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.