Fixed image exclusion to work with full regular expressions
Right now the image exclusion file (/etc/docker-gc-exclude) only supports basic regular expressions like so:
ubuntu:.*
random_image:latest
Syntax involving regular expression symbols like ^ or $ doesn't work. For example:
^ubuntu:.*$
^ttg-.*/:16$
Although in most cases what's supported is "good enough", it's rather confusing to only partially support typical regex operations. The reason it isn't supported seems to be a limitation of how the matching was done (basically repo:tag imageid is passed through with either the first or second block of text matching the regex).
This PR fixes that so that repo:tag is matched on its own followed by imageid on its own, and the resulting list of matching image IDs are combined.
This is backwards compatible and simply extends the functionality.
Thank-you @ownaginatious . This has solved my required images getting cleaned up.
No problem :+1: Now if only the maintainers of the repo actually looked at anyone's PRs...