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

Deleting manifest with Docker API does not delete all tags

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.26.1, 3.29.2
    • Fix Version/s: 3.31.0
    • Component/s: Docker
    • Labels:
    • Notability:
      3

      Description

      SYMPTOM:

      As per NEXUS-12711, deleting an image with Docker API would be supported, but if multiple tags are used, Nexus does not remove all tags.

      REPRODUCE STEPS:

      1. Prepare test image

      _NEXUS_HOST="<YOUR_NEXUS_HOST:DOCKER_PORT>"
      docker login ${_NEXUS_HOST}
      docker pull alpine:3.7
      docker tag alpine:3.7 ${_NEXUS_HOST}/alpine:3.7
      docker push ${_NEXUS_HOST}/alpine:3.7
      docker tag ${_NEXUS_HOST}/alpine:3.7 ${_NEXUS_HOST}/alpine:testtag
      docker push ${_NEXUS_HOST}/alpine:testtag
      

      2. Try deleting it

      # Find the digest
      curl -s -D/dev/stdout -u 'admin:admin123' -H 'Accept:application/vnd.docker.distribution.manifest.v2+json' -k https://${_NEXUS_HOST}/v2/alpine/manifests/3.7 | grep Docker-Content-Digest
      Docker-Content-Digest: sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b
      # Use above digest in delete
      curl -v -u 'admin:admin123' -X DELETE -k https://${_NEXUS_HOST}/v2/alpine/manifests/sha256:92251458088c638061cda8fd8b403b76d661a4dc6b7ee71b6affcf1872557b2b
      

      3. Run "Docker - Delete unused manifests and images" task against this testing docker repository.

      ACTUAL BEHAVIOUR:

      The curl -X DELETE does not delete the "testtag".
      The docker gc task also does not delete this tag.

      EXPECTED BEHAVIOUR:

      When deleting an image with Docker API, it should delete all tags.
      Or "Docker - Delete unused manifests and images" should delete those orphaned tags.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iudovika Igor Udovika
              Reporter:
              hosako Hajime Osako
              Last Updated By:
              Joe Tom Joe Tom
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response:

                  tigCommentSecurity.panel-title