0

I'm trying out nexus oss 3.0.1-01. I have a docker repository setup and I'm able to push and pull images successfully. But I need a way delete images. For docker, deleting a component won't actually delete the actual image layers from the file system because it maybe referred to by other components. So, what is the proper way to handle it?

I even deleted every single components and then ran a scheduled task to compact blob store. But that didn't seem to do much in terms of free up storage space.

My understanding is that there isn't a feature in nexus3 at the moment. If there is, could you please point me to some documentation on it? Otherwise, how is everyone else managing their storage space for docker repository?

aver
  • 555
  • 2
  • 7
  • 21

3 Answers3

1

We had a user contribute this recently:

https://gist.github.com/lukewpatterson/bf9d19410094ea8bced1d4bb0523b67f

You can read about usage here: https://issues.sonatype.org/browse/NEXUS-9293

As well, a supported feature for this will be coming soon from Sonatype.

DarthHater
  • 3,222
  • 25
  • 26
0

This is something that needs to be provided at the Docker Registry level. Currently it appears to be broken on v3.1

Did you try to go to assets and delete the layers? If that did not remove the files from the blob store, along with compact blob store, then it is a Nexus problem.

Make sure to tack this issues and confirm that this is the desired behavior for 3.2

See issues https://issues.sonatype.org/browse/NEXUS-9497 https://issues.sonatype.org/browse/NEXUS-9293

Astronaut
  • 6,691
  • 18
  • 61
  • 99
  • This does not provide answer to the question _How to delete docker image data or layer in nexus3_. – Tushar Nov 16 '16 at 03:03
  • 1
    @Tushar The answer is to go to assets and delete the layers. But there is an open bug, so this currently is broken – Astronaut Nov 16 '16 at 09:29
  • @Astronaut - Deleting assets/layers and delete them is not an option. First of all there is no clear way of knowing which layer belongs to which image by just looking at the information available in the UI. Secondly, one layer may be used by multiple images. So, deleting layers is not the way to go. I have seen that issue in Sonatype issue board and have been following it. Unfortunately, as of now there's no relevant update available. – aver Nov 16 '16 at 21:11
0

In Nexus 3.14 you go to WebUI -> Tasks -> Create -> Docker - Delete unused manifests and images

Then another job Admin - Compact blob store to actually rm the files from the Nexus directory.

Before that you need to delete the Nexus components (using the cleanup policy+job), as original poster did.

kubanczyk
  • 5,184
  • 1
  • 41
  • 52