kwk / docker-registry-frontend

Browse and modify your Docker registry in a browser.
https://registry.hub.docker.com/u/konradkleine/docker-registry-frontend/
MIT License
1.68k stars 616 forks source link

delete an image #158

Open bpiselli opened 7 years ago

bpiselli commented 7 years ago

Hello, It seems that it is not possible to delete an image as it is not activated https://github.com/kwk/docker-registry-frontend/blob/3ad864b388a24d5bef896b08593f8dfb3acf1357/start-apache.sh#L38-L47

Have I missed something ? When do you think it'll be available ?

pavel-veber commented 7 years ago

This? https://github.com/kwk/docker-registry-frontend/issues/106

stgarf commented 7 years ago

Delete doesn't work. But if you want to see what it looks like and potentially fix it here you go:

openssl req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -nodes -days 365

docker run -it -e ENV_USE_SSL=yes -e ENV_DOCKER_REGISTRY_HOST=MYREGISTRY.EXAMPLE.COM -e ENV_DOCKER_REGISTRY_PORT=443 -e ENV_DOCKER_REGISTRY_USE_SSL=1 -p 443:443 -v $PWD/server.crt:/etc/apache2/server.crt:ro -v $PWD/server.key:/etc/apache2/server.key:ro docker.io/konradkleine/docker-registry-frontend:v2 /bin/bash -c "sed -i -e 's/^ENV_MODE_BROWSE_ONLY=true$/ENV_MODE_BROWSE_ONLY=false/' /root/start-apache.sh ; /root/start-apache.sh"

You can then use CTRL+P CTRL+Q to exit the container while keeping it running.

You'll notice in the logs however:

DELETE /v1/repositories/example-repo/example-image/tags/v1 HTTP/1.1" 405 [...]

Maybe someone will have some time to work on a pull request for #106 👍 .

nabbar commented 7 years ago

To delete on a registry with an api v2 :

HTTP/1.1 202 Accepted

Note: when the DELETE curl is send you cannot pull the image no more. The api respond a 404 not found, but the files layerfs are stil existing. Only a run of garbage collector binary can delete the layerfs. This GC must be run into the local system of the registry api (into the shell of the container).