This is very-basic python built script that interacts with private docker registries that are setup to use basic auth. The tool can list all images, tags & optionally all FS layers that make an image. A image can be deleted & an exclude list allows to exlude certain images from deletion.
Simply get this script & run.
You need to know URL of your registry & the username & password used
No special steps needed to install anything - as long as you have python - you are all set
docker-registry-cli -h
Usage: ./docker-registry-cli [-s server] [-u username] [-p password] [-v verbose] [-d delete] [-e EXCLUDE]
-s --server Docker registry URL
-u --username docker registry user-name
-p --password docker registry user's password
-v --verbose verbose output
-d --delete deletes ALL images, provide exclusions via -e flag
-e --exclude list of repos to exclude comma-separated list, name:tag format
example: ./docker-registry-cli -s 139.156.121.159:5000 -u admin -p p@ssword -v true -d true -e foo:bar,foo1:bar1
- Python - Python
Feel free to extend the script share as you desire.
I highly encourage use of SemVer for versioning. For the versions available, see the tags on this repository.
- Sachin Dhamdhere - Initial work - Sachin Dhamdhere
This project is licensed under the MIT License - the text of which roughly goes as ...
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Drupad Panchal inspired parts of this script