find_tags.sh
· 513 B · Bash
Raw
#!/bin/bash
if [[ "$#" -eq 0 ]]; then
echo "Usage: $0 IMAGE [INCLUDE] [EXCLUDE]
IMAGE The image to search
Examples: httpd, lousilam/uptime-kuma
INCLUDE Include results containing INCLUDE
Pass '' to only use EXCLUDE filtering
EXCLUDE Exclude results containing EXCLUDE
"
exit 1
fi
image=$1
filter=$2
notfilter=${3:- }
jqfilter=".RepoTags[] \
| select(contains(\"$filter\")) \
| select(contains(\"$notfilter\") | not)"
skopeo inspect "docker://$image" \
| jq -r "$jqfilter"
1 | #!/bin/bash |
2 | |
3 | if [[ "$#" -eq 0 ]]; then |
4 | echo "Usage: $0 IMAGE [INCLUDE] [EXCLUDE] |
5 | IMAGE The image to search |
6 | Examples: httpd, lousilam/uptime-kuma |
7 | INCLUDE Include results containing INCLUDE |
8 | Pass '' to only use EXCLUDE filtering |
9 | EXCLUDE Exclude results containing EXCLUDE |
10 | " |
11 | exit 1 |
12 | fi |
13 | |
14 | image=$1 |
15 | filter=$2 |
16 | notfilter=${3:- } |
17 | jqfilter=".RepoTags[] \ |
18 | | select(contains(\"$filter\")) \ |
19 | | select(contains(\"$notfilter\") | not)" |
20 | |
21 | skopeo inspect "docker://$image" \ |
22 | | jq -r "$jqfilter" |