Bug 1304808
Summary: | docker info reports wrong image count | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Chris Evich <cevich> |
Component: | docker | Assignee: | smahajan <smahajan> |
Status: | CLOSED ERRATA | QA Contact: | atomic-bugs <atomic-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.2 | CC: | dwalsh, lsm5, lsu |
Target Milestone: | rc | Keywords: | Documentation, EasyFix, Extras |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
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:
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-06-23 16:17:50 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Chris Evich
2016-02-04 16:48:01 UTC
This appears fixed in/before 1.9.1-el7, still testing... 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. 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 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 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. Issue opened upstream. https://github.com/docker/docker/issues/20783 Will open a docs PR upstream for this. Shishir PR Opened upstream. https://github.com/docker/docker/pull/21174 Shishir New PR opened and merged upstream. https://github.com/docker/docker/pull/22336 Will be available in Docker 1.12. Shishir Nice! Thanks Shishir! 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) 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 |