A handy tool to query your self-hosted docker registry. Subcommand:
list
: list all available imagesdelete
: delete specified image
git clone https://github.com/YanBC/docker-registry.git
cd docker-registry
go install github.com/yanbc/docker-registry
To view the available commands and options, run:
docker-registry help
To list all the images available in a registry, run:
docker-registry list -addr <registry_address>
Replace <registry_address>
with the IP address and port number of your registry.
To delete an image, run:
docker-registry delete -repo <repo_full_name> [-tag <tag>]
Replace <repo_full_name>
with the full name of the repository you want to delete, in the format <registry_address>/<repo_name>
. If you want to delete a specific tag of an image, add the -tag
option.
- Regex in
seperate_image_full_name
andseperate_repo_full_name
- Add logging level option
Refactor, rename functions and variables- Fix bug in delete. When deleting images with the same digest, latter delete will fail with 404 http code.
- Add github actions for auto build and release.
In a self-hosted Docker registry, there are many image repositories (repo), each containing one or more images with multiple tags. A repository name and a tag together identify a specific image.
In this tool, we use the following naming conventions for variables:
registry
orendpoint
: The address (IP and port) of a Docker registry.repo
: The name of a repository.repo_full_name
: The full name of a repository, in the format<registry_address>/<repo_name>
.tag
: A specific tag associated with an image.image
: The name of an image, in the format<repo>:<tag>
.image_full_name
: The full name of an image, in the format<registry_address>/<repo>:<tag>
.