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

3

15

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?

Radioactive answered 14/9, 2015 at 11:33 Comment(1)
Looks like similar to: #29802702 . Also,This issue was discussed here github.com/docker/distribution/issues/422 .Oneirocritic
H
10

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
Hephzipah answered 30/9, 2015 at 9:7 Comment(0)
Z
16

Either use:

REGISTRY_STORAGE_DELETE_ENABLED=true

or define:

REGISTRY_STORAGE_DELETE_ENABLED: "yes"

in docker-compose.

Zoroastrianism answered 28/4, 2016 at 14:11 Comment(0)
H
10

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
Hephzipah answered 30/9, 2015 at 9:7 Comment(0)
I
0

I spent a full day with this

In case you have already added delete: enabled

storage:
  delete: 
    enabled: true

and/or REGISTRY_STORAGE_DELETE_ENABLED=true

And still does not work, ensure that you have not created your docker registry as a pull-through cache. i.e, ensure that you don't have a proxy field

proxy:
  remoteurl: https://registry-1.docker.io

in your config.yml

Interfluent answered 24/3, 2023 at 15:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.