Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I delete a layer in my private docker registry(v2)?

I have just installed the docker-registry in stand-alone mode successfully and I can use the following command

curl -X GET http://localhost:5000/v2/

to get the proper result.

However, when I use

curl -X DELETE http://localhost:5000/v2/<name>/blobs/<digest>

to delete a layer, it fails, I get:

{"errors":[{"code":"UNSUPPORTED","message":"The operation is unsupported."}]}

I use the default configuration from the docker hub. And I studied the official configuration but failed to resolve it.

How can I make it out?

like image 989
sixgodwater Avatar asked Sep 14 '15 11:09

sixgodwater


2 Answers

You have to add the parameter delete: enabled: true in /etc/docker/registry/config.yml

make it look like that :

 version: 0.1
 log:
    fields:
        service: registry
 storage:
    cache:
        layerinfo: inmemory
    filesystem:
        rootdirectory: /var/lib/registry
    delete:
        enabled: true
 http:
    addr: :5000

take a look here for more details

Or by adding an environment var to the container on boot :

-e REGISTRY_STORAGE_DELETE_ENABLED=true
like image 139
wilsonW Avatar answered Sep 24 '22 18:09

wilsonW


Either use:

REGISTRY_STORAGE_DELETE_ENABLED=true

or define:

REGISTRY_STORAGE_DELETE_ENABLED: "yes"

in docker-compose.

like image 29
Martin Tapp Avatar answered Sep 25 '22 18:09

Martin Tapp