Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Docs: Add example exclude entry matching all tags #74

Merged
merged 1 commit into from
Dec 3, 2015

Conversation

dgoodlad
Copy link
Contributor

@dgoodlad dgoodlad commented Dec 1, 2015

There was no example of the match pattern used other than "patterns (in the grep sense)", which tripped me up as I was using unescaped + in my patterns which didn't match anything. An example here should help avoid others' confusion 😄

There was no example of the match pattern used other than "patterns (in the `grep sense)", which tripped me up as I was using unescaped `+` in my patterns which didn't match anything. An example here should help avoid others' confusion 😄
@mattnworb
Copy link
Member

Thanks @dgoodlad !

Small question though - the script basically passes the output of docker images (after some transforms) to the standard input of grep -f <file containing excludes>. So instead of matching redis:[^ ]\+ (to match any tag of the redis image I presume) couldn't you also just have the pattern be redis: ?

@dgoodlad
Copy link
Contributor Author

dgoodlad commented Dec 3, 2015

@mattnworb I tried that, but discovered after winding through the code that the patterns here get transformed by

sed 's/^\(.*\)$/ \1 /' $EXCLUDE_FROM_GC | sed '/^ *$/d' > $PROCESSED_EXCLUDES
, adding a space to the beginning and end, like so:

"redis:" -> " redis: "
"redis:[^ ]\+" -> " redis:[^ ]\+ "

The former will not match redis:latest, while the latter will.

The extra spaces were what made figuring out exactly how to use the "grep style" pattern matching work difficult 😄

@mattnworb
Copy link
Member

Gotcha, thanks for clarifying.

mattnworb added a commit that referenced this pull request Dec 3, 2015
Docs: Add example exclude entry matching all tags
@mattnworb mattnworb merged commit e194bc0 into spotify:master Dec 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants