title: Docker registry - removing manifests from filesystem
body: <p>My CI pushes images to docker registry under one tag. I have a script that periodically cleans old unuser images. It just iterates over digests inside tag and calls DELETE on registry API (iterating over files on registry filesystem).</p>
  
  <pre><code>dir="${REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY}/docker/registry/v2/repositories/test/_manifests/tags/5.3/index/sha256/"
  oldManifests=$(ls -t $dir | tail -n +2 ; done)
  for hash in $oldManifests
  do
      curl  -L -X DELETE http://localhost:5000/v2/test/manifests/sha256:$hash
  done
  
  /bin/registry garbage-collect /etc/docker/registry/config.yml
  </code></pre>
  
  <p>After garbage-collect all blobs are removed but not directories under _manifests/tags/5.3/index/sha256/ . Why? Is it safe to delete them manually?</p>