File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+ # set -x
5+
6+ REGISTRY_URL=" docker-registry.nginx.com/nginx"
7+ IMAGE_NAME=${1:- " " }
8+
9+ search=${2:- " " }
10+
11+ usage () {
12+ echo " Usage: $0 <image-name> [search-pattern]"
13+ echo " Example: $0 agentv3 alpine"
14+ exit 1
15+ }
16+
17+ if [[ -z " ${IMAGE_NAME} " ]]; then
18+ usage
19+ fi
20+
21+ echo " Checking images in ${REGISTRY_URL} /${IMAGE_NAME} "
22+
23+ # Fetch all tags from the remote registry
24+ skopeo list-tags docker://${REGISTRY_URL} /${IMAGE_NAME} | jq -r ' .Tags[]' > all_tags.txt
25+ echo $( wc -l < all_tags.txt) " tags fetched."
26+
27+ # Filter out tags that end with three or more digits (nightly/build tags)
28+ grep -Ev ' \d{3,}$' all_tags.txt | sort -u > filtered_tags.txt
29+ echo $( wc -l < filtered_tags.txt) " tags after filtering."
30+
31+ FOUND=($( grep -E " ${search} " filtered_tags.txt | sort) ) || { echo " No tags found matching '${search} '" ; exit 1; }
32+ echo " tags matching '${search} ':" ${# FOUND[@]}
33+
34+ for tag in " ${FOUND[@]} " ; do
35+ echo " :: ${REGISTRY_URL} /${IMAGE_NAME} :$tag "
36+ podman pull ${REGISTRY_URL} /${IMAGE_NAME} :$tag > /dev/null 2>&1
37+ podman run ${REGISTRY_URL} /${IMAGE_NAME} :$tag nginx -v
38+ podman run ${REGISTRY_URL} /${IMAGE_NAME} :$tag nginx-agent --version
39+ podman rm -f $( podman ps -a -q) > /dev/null 2>&1 || true
40+ done
41+
You can’t perform that action at this time.
0 commit comments