Open bpiselli opened 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 👍 .
To delete on a registry with an api v2 :
get the digest of the repos/image/tag call like that : (note the header Accept is mandatory)
curl -u "user:password" -k -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -X GET https://regaddr:5000/v2/repos/path/image/manifests/latest | grep 'Docker-Content-Digest' | awk '{print ($3)}'
>>> sha256:42aa4b5f4eed005af417a1c445a1366a72d05a8396e79a1ba62da1ef774984c8
curl -u "user:password" -k -v --silent -X DELETE https://regaddr:5000/v2/repos/path/image/manifests/sha256:42aa4b5f4eed005af417a1c445a1366a72d05a8396e79a1ba62da1ef774984c8
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).
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 ?