This commit is contained in:
nyyu 2024-01-04 19:32:18 +01:00
parent 8b55fc20ae
commit 9da289b91b
2 changed files with 3 additions and 2 deletions

View file

@ -8,7 +8,7 @@ networks:
services: services:
grafana: grafana:
image: grafana/grafana:10.2.2 image: grafana/grafana:10.2.3
container_name: grafana container_name: grafana
restart: unless-stopped restart: unless-stopped
volumes: volumes:

View file

@ -3,7 +3,8 @@ images=$(grep 'image:' docker-compose.yml | grep -v '#' | sed 's/^ *//' | cut -d
for image in $images for image in $images
do do
if [[ $image != gcr* ]]; then if [[ $image != gcr* ]]; then
ver=$(curl -s https://registry.hub.docker.com/v2/repositories/${image}/tags | jq -r '[.results[] | select(.name | contains("ubuntu") | not) | select(.name | contains("main") | not ) | select(.name | contains("master") | not ) | select(.name | contains("latest") | not) | select(.name | contains("rc") | not) | select(.name | contains("-") | not) | select(.name | contains("."))] | sort_by(.name|sub("^v";"")|split(".")|map(tonumber)) | reverse | first | .name') # ver=$(curl -s https://registry.hub.docker.com/v2/repositories/${image}/tags | jq -r '[.results[] | select(.name | contains("ubuntu") | not) | select(.name | contains("main") | not ) | select(.name | contains("master") | not ) | select(.name | contains("latest") | not) | select(.name | contains("rc") | not) | select(.name | contains("-") | not) | select(.name | contains("."))] | sort_by(.name|sub("^v";"")|split(".")|map(tonumber)) | reverse | first | .name')
ver=$(curl -s https://registry.hub.docker.com/v2/repositories/${image}/tags?page_size=20 | jq -r '[.results[] | select(.name | test("^v?[0-9|.]+(-alpine)?$")) ] | sort_by(.name|sub("^v";"")|split(".")|map(tonumber)) | reverse | first | .name')
echo "$image:$ver" echo "$image:$ver"
sed -i "s#image: $image:.*#image: $image:$ver#" docker-compose.yml sed -i "s#image: $image:.*#image: $image:$ver#" docker-compose.yml
fi fi