Bug 1351406 - nuke_images.sh can't remove image whose name or tag is <none>
Summary: nuke_images.sh can't remove image whose name or tag is <none>
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 3.2.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: Anping Li
Depends On:
TreeView+ depends on / blocked
Reported: 2016-06-30 03:19 UTC by Anping Li
Modified: 2017-03-08 18:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously a bug in a script which cleans out all pre-existing images and containers during a Docker 1.10 upgrade would cause the script to miss some images with name and tag "none", potentially resulting in a slower or failed Docker upgrade. This script has been updated to use a more robust method of cleanup which also catches orphaned images.
Clone Of:
Last Closed: 2016-09-27 09:39:02 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC

Description Anping Li 2016-06-30 03:19:53 UTC
Description of problem:
nuke_images.sh can't remove images whose name or tag is <none>.

#docker images          <none>              a692aced3630        36 minutes ago      509.2 MB
<none>                                                                 <none>              ee3b177d0a43        58 minutes ago      509.2 MB

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1) install atomic-openshift-utils and copy /usr/share/ansible/openshift-ansible/playbooks/byo/openshift-cluster/upgrades/docker/files/nuke_images.sh to openshift hosts
2) run nuke_images.sh

Actual results:
+ docker rmi REPOSITORY:TAG '<none>' '<none>:<none>' '<none>:<none>' '<none>' virt-openshift-05.lab.eng.nay.redhat.com:5000/openshift3/ose-pod:v3.2.1.1 virt-openshift-05.lab.eng.nay.redhat.com:5000/openshift3/node:v3.2.1.1 virt-openshift-05.lab.eng.nay.redhat.com:5000/openshift3/ose:v3.2.1.1 virt-openshift-05.lab.eng.nay.redhat.com:5000/openshift3/openvswitch:v3.2.1.1

Expected results:

Additional info:

Comment 1 Anping Li 2016-07-22 08:22:22 UTC
Still can't remove image '<none>'.

[root@host4node ~]# docker images
REPOSITORY                              TAG                 IMAGE ID            CREATED             VIRTUAL SIZE   <none>              41948e00ba1e        47 hours ago        516.5 MB

[root@host4node ~]# sh nuke_images.sh docker
++ docker ps -q
+ running_container_ids=
+ test -n ''
++ docker ps -a -q
+ container_ids=
+ test -n ''
++ docker images -q
+ image_ids=41948e00ba1e
+ test -n 41948e00ba1e
++ docker images
++ grep '/\|/ \|  \| \|-\|_'
++ awk '{print $1 ":" $2}'
+ docker rmi REPOSITORY:TAG '<none>'
+ echo 'No images matching "" left to purge.'
No images matching "" left to purge.

Comment 2 Devan Goodwin 2016-07-22 18:29:03 UTC
This script is a real pain to get correct. The problem is quite low priority so I'm going to set this aside for now. Worst case scenario these images will get auto upgraded.

Comment 3 Devan Goodwin 2016-07-22 19:04:55 UTC
Anping let me know if you have a good reproducer for getting a <none>:<none> orphaned image, I can't quite seem to do it.

Comment 4 Anping Li 2016-07-24 23:26:08 UTC
oc new-app cakephp-example, this command will create<none>

Comment 5 Devan Goodwin 2016-08-15 13:15:02 UTC
I think this could be considered fixed now, however I can't fully guarantee nuke_images.sh will get everything, Docker has been quite fussy about what it will delete and sometimes just outright breaks. However the new changes arrived in:


You can see all the details in there but I think the new method of clearing out images might be more reliable, and should get these none/none orphans. This should be built with openshift-ansible-3.3.10-1 so I will move to ON_QA.

Comment 6 Anping Li 2016-08-16 06:15:01 UTC
Verified and pass, those images with <none> tag was removed.

Comment 8 errata-xmlrpc 2016-09-27 09:39:02 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.


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