Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1342055

Summary: atomic pulled image can't remove by docker rmi or atomic uninstall
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: dwalsh, pthomas
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 14:21: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:
Bug Depends On: 1386519    
Bug Blocks:    

Description Alex Jia 2016-06-02 11:00:11 UTC
Description of problem:
Using atomic pull an image then try to remove it by docker rmi or atomic uninstall, it will be failed.

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

$ rpm -q atomic docker kernel
atomic-1.10.3-1.el7.x86_64
docker-1.10.3-26.el7.x86_64
kernel-3.10.0-327.el7.x86_64

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.2 (Maipo)


How reproducible:
always

Steps to Reproduce:
1. atomic pull busybox
2. docker rmi `sudo docker images -a -q`
3. atomic images
4. atomic uninstall <image id> or <image name>

Actual results:

$ sudo atomic pull busybox
Missing layer a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
Missing layer 385e281300cc6d88bdd155e0931fbdfbb1801c2b0265340a40481ee2b733ae66

$ sudo atomic images

  REPOSITORY                         TAG      IMAGE ID       CREATED            VIRTUAL SIZE  
  registry.access.redhat.com/rhel7   latest   sha256:bf203   2016-05-05 12:43   203.43 MB     
  docker.io/busybox                  latest   sha256:47bcc   2016-03-18 14:22   1.11 MB       
> docker.io/fedora                   latest   sha256:507cb   2016-03-04 13:40   204.69 MB     
  busybox                            latest   busybox:late   2016-06-02 05:10         

$ sudo docker rmi `sudo docker images -a -q`
Untagged: registry.access.redhat.com/rhel7:latest
Deleted: sha256:bf203442783741aad6d82b528bcfecd45f40e63c83d981eb5e644a2fa6356e60
Deleted: sha256:afafa291bfccd3bc6b77a09d65492cd94d210299c8dff589601d3fbab616ede9
Untagged: docker.io/busybox:latest
Deleted: sha256:47bcc53f74dc94b1920f0b34f6036096526296767650f223433fe65c35f149eb
Deleted: sha256:f6075681a244e9df4ab126bce921292673c9f37f71b20f6be1dd3bb99b4fdd72
Deleted: sha256:1834950e52ce4d5a88a1bbd131c537f4d0e56d10ff0dd69e66be3b7dfa9df7e6
Untagged: docker.io/fedora:latest
Deleted: sha256:507cb13a216097710f0d234668bf64a4c92949c573ba15eba13d05aad392fe04
Deleted: sha256:423ada7a72d33febcff7833c97783c17f846defe29b7d98ff75136879a40d6e5

$ sudo atomic images

  REPOSITORY TAG      IMAGE ID       CREATED            VIRTUAL SIZE  
  busybox   latest   busybox:late   2016-06-02 05:10           

$ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

In fact, it doesn't exist in output of docker images.

$ sudo atomic uninstall busybox:latest
Image 'busybox:latest' is not installed

$ sudo atomic uninstall busybox:late
Image 'busybox:late' is not installed

$ sudo docker rmi busybox:latest
Failed to remove image (busybox:latest): Error response from daemon: No such image: busybox:latest


Expected results:


Additional info:

we have a incorrect IMAGE ID 'busybox:late' for busybox, maybe, we can't remove it by image id, but the full qualified image name also doesn't work.

Comment 2 Antonio Murdaca 2016-06-03 20:06:27 UTC
This seems to be a bug in atomic rather than in Docker

Comment 3 Daniel Walsh 2016-08-26 15:56:45 UTC
I believe this is a system container issue.  The image is installed in ostree.

Comment 4 Daniel Walsh 2016-08-26 15:57:48 UTC
Giuseppe is this fixed?

Comment 5 Giuseppe Scrivano 2016-08-26 16:31:44 UTC
yes, it is a system container and in the new version of atomic we make it clear from the "images list" output.  We also added a "images delete" command that simplifies the task of removing an image, either docker container or system image.

The way to delete that, in the older version, is to delete directly the ostree branch:

"ostree refs --delete ociimage/busybox-latest && ostree prune --refs-only"

Comment 6 Daniel Walsh 2016-08-26 16:54:44 UTC
Does atomic uninstall remove the image?  I don't think so and I am not sure it should .

I guess atomic image delete is the proper way now.

We might want to add some data to atomic pull
to indicate which backing store the images is being pulled to.  Especially if we add support for docker, ostree and containers/storage.

Comment 7 Giuseppe Scrivano 2016-08-26 21:46:40 UTC
we already have a --storage option for pull (which now understands only ostree).  "atomic uninstall" does not remove the image, it uninstalls a container.

Yes, 'atomic images delete' is the equivalent of 'docker rmi', which works both for system container and docker containers.

Should this bug be marked as RELEASE_PENDING?

Comment 8 Daniel Walsh 2016-08-27 09:50:34 UTC
Giuseppe could you make a pull request to make it clear where atomic pull is pulling to.

atomic pull foobar
-> foobar image is being installed into ostree ...

Comment 9 Giuseppe Scrivano 2016-08-27 17:42:35 UTC
I have added a message to the user in this PR:

https://github.com/projectatomic/atomic/pull/566

Comment 10 Daniel Walsh 2016-10-18 17:00:36 UTC
Fixed in atomic-1.13

Comment 11 Alex Jia 2016-10-19 15:23:23 UTC
(In reply to Daniel Walsh from comment #10)
> Fixed in atomic-1.13

At present, I can use the following methods to delete images are pulled by atomic.

1. atomic uninstall <image>
2. atomic -y images delete <image>
3. docker rmi <image>

[root@atomic-host-001 cloud-user]# rpm -q atomic skopeo docker
atomic-1.13.1-3.el7.x86_64
skopeo-0.1.17-0.4.git550a480.el7.x86_64
docker-1.10.3-55.el7.x86_64