Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of IMAGE:TAG syntax #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ Note that deleting by age will not prevent more recent tags from being deleted i
```
registry.py -r https://example.com:5000 --dry-run --delete --keep-by-hours 72 --keep-tags-like latest
```

Alternative method of deleting an explicit tag of an image:
```
registry.py -r https://example.com:5000 --dry-run --delete --num 0 --image example:latest
```

## Disable ssl verification

If you are using docker registry with a self signed ssl certificate, you can disable ssl verification:
Expand Down
19 changes: 14 additions & 5 deletions registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,22 @@ def main_loop(args):
print("---------------------------------")
print("Image: {0}".format(image_name))

all_tags_list = registry.list_tags(image_name)
# get tags from image name if any
if ":" in image_name:
(image_name, tag_name) = image_name.split(":")
all_tags_list = registry.list_tags(image_name)
if not tag_name in all_tags_list:
print(" no such image: {0}:{1}".format(image_name, tag_name))
continue
tags_list = set([tag_name])
else:
all_tags_list = registry.list_tags(image_name)

if not all_tags_list:
print(" no tags!")
continue
if not all_tags_list:
print(" no tags!")
continue

tags_list = get_tags(all_tags_list, image_name, args.tags_like)
tags_list = get_tags(all_tags_list, image_name, args.tags_like)

# print(tags and optionally layers
for tag in tags_list:
Expand Down