# Purge old docker images and keep X number of image in repo

**URL:** <https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677>\
**Category:** Sonatype Nexus Repository\
**Tags:** help\
**Created:** [October 17, 2018, 6:57am UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677 "2018-10-17T06:57:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhisons0007](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@abhisons0007](https://community.sonatype.com/u/abhisons0007)\
**Post date:** [October 17, 2018, 6:57am UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677/1 "2018-10-17T06:57:16Z")

</div>

Hi

Using Nexus 3.13 version and i wanted to purge my docker mainfiest and images and keep only X number of images for all my microservices.

Could any one tell how can i do that .

Regards  
abhinav D

---

<div class="post-metadata">

**Author:** ![soprahr-01](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@soprahr-01](https://community.sonatype.com/u/soprahr-01)\
**Post date:** [May 28, 2019, 7:43am UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677/2 "2019-05-28T07:43:46Z")

</div>

did you find any solution for this ?

---

<div class="post-metadata">

**Author:** ![dylan.miracle](https://avatars.discourse-cdn.com/v4/letter/d/77aa72/32.png) [@dylan.miracle](https://community.sonatype.com/u/dylan.miracle)\
**Post date:** [June 25, 2019, 6:28pm UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677/3 "2019-06-25T18:28:05Z")

</div>

bump. Anyone have a solution for this?

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [June 25, 2019, 7:59pm UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677/4 "2019-06-25T19:59:06Z")

</div>

We don’t yet have a cleanup policy that can do exactly what you’re asking for, but if you upgrade your Nexus Repo to a newer version you can use some of our new cleanup policies to reduce space:

[https://help.sonatype.com/display/NXRM3/Cleanup+Policies](https://help.sonatype.com/display/NXRM3/Cleanup+Policies)

---

<div class="post-metadata">

**Author:** ![andras.nagy](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@andras.nagy](https://community.sonatype.com/u/andras.nagy)\
**Post date:** [January 10, 2024, 1:53pm UTC](https://community.sonatype.com/t/purge-old-docker-images-and-keep-x-number-of-image-in-repo/677/5 "2024-01-10T13:53:21Z")

</div>

Anyone have a solution for this? This is needed by default without groovy script hacking…
