Bug 1290237 - [RFE] Delete Docker Images from private registry
[RFE] Delete Docker Images from private registry
Status: ASSIGNED
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE (Show other bugs)
3.1.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michal Minar
Johnny Liu
:
Depends On:
Blocks: 1267746
  Show dependency treegraph
 
Reported: 2015-12-09 17:17 EST by Eric Jones
Modified: 2017-05-10 07:20 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Jones 2015-12-09 17:17:37 EST
- What is the nature and description of the request?  
As an admin I need the ability to delete docker images from my private registry established for OpenShift v3.1. With no way to delete them, all they do is build up and take up space. Currently the only way to do this is through Docker Registry v2 api calls.

- Why does the customer need this? (List the business requirements here)  
The docker images they have pushed to their registry are taking up too much space (>80 GB). They are currently unable to remove any of the images.

- How would the customer like to achieve this? (List the functional requirements here)  
A command for OpenShift that deletes the docker images. A possible fix is a command that will run these api calls.  

- Is there already an existing RFE upstream or in Red Hat Bugzilla?  
Not that I could find  

- List any affected packages or components.  
OpenShift
Docker
Comment 2 Paul Weil 2015-12-09 17:31:21 EST
Hi Eric.  Is this not doing what you need: https://docs.openshift.org/latest/admin_guide/pruning_resources.html#pruning-images
Comment 3 Eric Jones 2015-12-09 17:37:39 EST
Hi Paul, the only issue with that is it doesn't seem to leave any room for specifying what images to remove. It only suggests removing old images, not allowing certain images, and their later versions, to be completely removed from the registry. Please correct me if my understanding of this command is incorrect.
Comment 4 Paul Weil 2015-12-10 09:29:04 EST
Thanks, that makes sense.  For now, if you want to remove specific images from the internal registry you should be able to log in to the registry and run the docker cli commands to do so.  

I think being able to specify which images to prune is reasonable.
Comment 5 Eric Jones 2015-12-10 10:08:41 EST
Paul, just to be certain, when you say login "and run the docker cli commands to do so" you mean using things like `docker rmi`? Has that been confirmed to work with the OpenShift internal Docker Registry? I thought that would only remove the images from the local download (i.e. the images you get when you run `docker pull`) not the ones that you have tagged and then pushed to your internal registry? 

The only way that I have found to delete images from a private registry is to use api calls that I haven't even been able to verify yet. An example of these can be found at http://www.mooshammer.us/blog/2014/12/24/basics-operation-on-a-private-docker-registry/
Comment 6 Michal Minar 2015-12-10 10:36:58 EST
Eric,

does a deletion of images in following way address your/customers issue?

$ oc get images
NAME                                                                      DOCKER REF
sha256:3515aebe23e2779fd10132a4e15ec15c654e3e7ed93170d58db00ae5e53713cf   172.30.230.44:5000/joe1/ose-haproxy-router@sha256:3515aebe23e2779fd10132a4e15ec15c654e3e7ed93170d58db00ae5e53713cf
sha256:3cbc62aa1596f0dd9bc8da0acda0a5bb07397ae30ce92455890023bd1c22cd5d   172.30.230.44:5000/joe1/hello-openshift@sha256:3cbc62aa1596f0dd9bc8da0acda0a5bb07397ae30ce92455890023bd1c22cd5d
sha256:4940bf54fe4f3237913f7eab399ae44a38ec544057fd687109163c123c982615   172.30.230.44:5000/joe1/secured@sha256:4940bf54fe4f3237913f7eab399ae44a38ec544057fd687109163c123c982615
# delete all images in joe1/hello-openshift
$ oc get images | sed -n 's,.*joe1/hello-openshift@\(.*\),images/\1,p' | xargs oc delete
# wait for registry's prune to remove any garbage
Comment 7 Michal Minar 2015-12-10 10:42:15 EST
I'm affraid those API calls are soft deletes only. The deleted manifests/layers/blobs will no longer be available for pulls but the content will be still stored on registry's storage.
Comment 8 Eric Jones 2015-12-10 11:19:26 EST
Michal,

Thank you for that information on the api calls. Do you know how long it would take for the registry to remove any garbage? I am trying to test it in my environment, and it might simply be impatience, but I am not seeing any change yet.

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