RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1304808 - docker info reports wrong image count
Summary: docker info reports wrong image count
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: smahajan@redhat.com
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-04 16:48 UTC by Chris Evich
Modified: 2019-03-06 01:03 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The numer of images installed in a docker environment is being reported incorrectly in the docker info command. Consequence: Bad data. Fix: Report the correct number of images. Result:
Clone Of:
Environment:
Last Closed: 2016-06-23 16:17:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1274 0 normal SHIPPED_LIVE docker bug fix and enhancement update 2016-06-23 20:12:28 UTC

Description Chris Evich 2016-02-04 16:48:01 UTC
Description of problem:
Unless I'm doing something incredibly stupid yet not obvious.

Version-Release number of selected component (if applicable):
# rpm -q docker
docker-1.8.2-10.el7.x86_64
# docker version
Client:
 Version:      1.8.2-el7
 API version:  1.20
 Package Version: docker-1.8.2-10.el7.x86_64
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:        
 OS/Arch:      linux/amd64

Server:
 Version:      1.8.2-el7
 API version:  1.20
 Package Version: 
 Go version:   go1.4.2
 Git commit:   a01dc02/1.8.2
 Built:        
 OS/Arch:      linux/amd64

How reproducible:
Mostly trivial, may help to have a bunch of images and at least one container running (untested).

Steps to Reproduce:
1. docker images --all | tail -n +1 | wc -l
2. docker info | grep 'Images'

Actual results:
54 != 51
(actual value may vary)

Expected results:
54 == 54
(actual value may vary)

Additional info:
I'll check newer builds in a second...

Comment 2 Chris Evich 2016-02-04 17:54:31 UTC
This appears fixed in/before 1.9.1-el7, still testing...

Comment 3 Chris Evich 2016-02-04 18:32:18 UTC
okay, reproduced on 1.9.1 and there is one mistake I made, should be tail -n +2  
Corrected repro. steps:

0. # docker info
   confirm 'Images: 0'
1. Make a bunch of images
   # for n in `seq 1 20`; do for img in rhel sadc rsyslog; do docker run registry.access.redhat.com/rhel7/$img echo $RANDOM; docker run docker.io/rhel7/$img echo $RANDOM; done; done
   # for cid in `docker ps -aq`; do docker commit $cid; done
2. # docker images --all | tail -n +2 | wc -l
   shows 66
3. # docker info | grep Images
   shows Images: 63

Found I could only repro. this if I grabbed duplicate images w/ different names.  If I only grab 4.e.g. from docker.io, then the counts are correct.

Comment 4 smahajan@redhat.com 2016-02-06 18:53:12 UTC
Hi Chris,

When you do `docker info` SystemInfo (https://github.com/docker/docker/blob/master/daemon/info.go#L26) method is called, which gets the images count from imageStore.

daemon.imageStore.Map()
https://github.com/docker/docker/blob/master/daemon/info.go#L72

This map returns information about the images. (Tags are not part of this store).
Hence when you do `docker images --all|wc -l` you see a different count as tags are also included in the output.

Hope that clears up the confusion.

Shishir

Comment 5 Chris Evich 2016-02-08 20:44:47 UTC
Okay, that makes sense for 'how' it's happening.  Next step is, will any consumers (including humans) of this 'docker info' data, care?

Is this documented anywhere?  (Otherwise we're relying on someone struggling with this, to find this bug in a google search :)  

Otherwise, yeah it's probably fine to close this.  I can't think of any reason except for documentation how this could have a negative affect.


As for testing, I'll do something like this instead:

docker images --all --quiet | sort -u | wc -l

Comment 6 Chris Evich 2016-02-12 14:36:04 UTC
Okay, just checked.  The man-page for 'docker info' is in need of some love.  Clarifying the 'Images' and 'Containers' count with what they actually represent would be 'nice to have'.  On F22, it has this blurb:

This  command  displays  system  wide information regarding the Docker installation. Information displayed includes the number of containers and images, pool name,  data file,  metadata file, data space used, total data space, metadata space used , total metadata space, execution driver, and the kernel version.

and the example section is really out of date (OS: Ubuntu 14 and Kernel 3.13).  Would make the guys in marketing happier if it showed Fedora/CentOS/RHEL instead and maybe showed the typical devicemapper details instead of aufs (not used any more, anywhere IIRC).

Here's a suggestion for the description blurb:

This  command  displays  system  wide information regarding the Docker installation. Information displayed includes the number of containers and (non-tagged) images, pool name,  image storage details, space available and used, execution driver, OS and the kernel versions.

Comment 8 smahajan@redhat.com 2016-02-29 14:37:19 UTC
Issue opened upstream.
https://github.com/docker/docker/issues/20783

Will open a docs PR upstream for this.

Shishir

Comment 9 smahajan@redhat.com 2016-03-14 18:37:04 UTC
PR Opened upstream.

https://github.com/docker/docker/pull/21174

Shishir

Comment 10 smahajan@redhat.com 2016-05-04 19:26:54 UTC
New PR opened and merged upstream.
https://github.com/docker/docker/pull/22336

Will be available in Docker 1.12.

Shishir

Comment 11 Chris Evich 2016-05-05 16:43:44 UTC
Nice! Thanks Shishir!

Comment 13 Luwen Su 2016-06-11 17:13:59 UTC
In docker-1.10.3-40.el7.x86_64, checked the man page and
the info looks like this:

#docker info
Containers: 5
 Running: 1
 Paused: 0
 Stopped: 4
Images: 4
Server Version: 1.10.3
Storage Driver: devicemapper
 Pool Name: docker-253:3-68819104-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 107.4 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 685.3 MB
 Data Space Total: 107.4 GB
 Data Space Available: 16.02 GB
 Metadata Space Used: 1.401 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.146 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.107-RHEL7 (2015-12-01)
Execution Driver: native-0.2
Logging Driver: journald
Plugins: 
 Volume: local
 Network: bridge null host
 Authorization: rhel-push-plugin
Kernel Version: 3.10.0-327.el7.x86_64
Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 2
Total Memory: 992.8 MiB
Name: myregistrydomain.com
ID: KU2E:E3TH:5SEP:FWNB:2TKE:A3KF:FEMA:Z5D6:PYQE:GCJG:JET2:WIUM
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Registries: registry.access.redhat.com (secure), docker.io (secure)

Comment 15 errata-xmlrpc 2016-06-23 16:17:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1274


Note You need to log in before you can comment on or make changes to this bug.