Docker Community Forums

Share and learn in the Docker community.

No files deleted when I call url API of Docker Registry?


(zepouet) #1

Hello,

I am trying to clean up the docker registry with the API calls.
To understand my problem I will give the complete registry configuration

docker run -d -p 5000:5000 -p 5001:5001 --restart=always --name registry \ 
-e REGISTRY_STORAGE_DELETE_ENABLED=true \  
-v `pwd`/data:/var/lib/registry \ 
-v `pwd`/config.yml:/etc/docker/registry/config.yml registry:2 

and the config file

version: 0.1
log:
  fields:
    service: registry
storage:
    cache:
        blobdescriptor: inmemory
    filesystem:
        rootdirectory: /var/lib/registry
    delete:
        enabled: true
    maintenance:
        uploadpurging:
           enabled: true
           age: 168h
           interval: 1m
           dryrun: true
        readonly:
           enabled: false
http:
    addr: :5000
    headers:
        X-Content-Type-Options: [nosniff]
health:
  storagedriver:
    enabled: true
    interval: 10s
    threshold: 3

I can call the API with

curl -v -XDELETE localhost:5000/v2/coucou/blobs/sha256:c431ca187a895d44e25947d55d51fd54709a28f7b75b48e3a68cd2106b72f007

I have a right 202 code the first call and 404 the second. All is right but never files are deleted onto disk.
I can run many times du -a data | wc and the numbers never changed.

So how can we be sure the data will be garbaged ? Soft garbaged ?

Thanks you very much for any advices.
Best regards,