Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-9293

add a task to purge dangling docker images

    XMLWordPrintable

    Details

      Description

      Typically we build images tagged as "latest" after SCM change automatically in CI and we push them to registry. It is basically the same as with SNAPSHOT deployed by maven. As result there are many "dangling" images that in our case take significant amount of space.

      Usually when you re-build image, meaning you tag newly build image with an already existing tag, you will see "dangling" image in "docker images" output. And you would delete it with:
      docker rmi $(docker images -q -f dangling=true)

      Basically what we need is something similar to scheduled task named "Remove Snapshots From Repository" for removing old SNAPSHOTs deployed by maven.

      For example Docker registry V2, provides maintenance function called "upload purging" for this purpose. See https://docs.docker.com/registry/configuration/

      Acceptance Criteria:

      • A user with sufficient privileges will be able to schedule a task to delete orphaned Docker layers
        • This should be able to run on Hosted and Proxy

      NOTE:

      TECHNICAL NOTE:

      • Do not purge any layer newer than when the task started running

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jtom Joe Tom
                Reporter:
                vehovmar Martin Vehovsky
                Last Updated By:
                markus buchner
              • Votes:
                41 Vote for this issue
                Watchers:
                45 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: