From 5cbadb435226c9ec1d2ab2d917aa814b80036608 Mon Sep 17 00:00:00 2001 From: Rolf Timmermans Date: Mon, 30 Sep 2024 10:40:34 +0200 Subject: [PATCH] Untag all images after building 1 version at the end. --- create-latest | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/create-latest b/create-latest index 8a06ad0..8241e71 100755 --- a/create-latest +++ b/create-latest @@ -1,15 +1,20 @@ #!/bin/bash IMAGES=$(find . -maxdepth 1 -type d -not -name '.*' -not -name '_*' -exec basename {} \; | sort) +IMAGES_REV=$(echo "$IMAGES" | tac) VERSIONS=$(wget https://alpinelinux.org/releases.json -q -O - | jq -r '(.release_branches | map(.rel_branch)) - ["edge"] | map(sub("v"; ""))[0:6][]') -echo Building images: $IMAGES +echo Building images: $IMAGES_REV echo Building versions: $VERSIONS IFS=$'\n' -for image in $IMAGES; do - for version in $VERSIONS; do +for version in $VERSIONS; do + for image in $IMAGES; do ./create "$image" "$version" + done + + # Untag all images + for image in $IMAGES_REV; do docker image rm "voormedia/${image}:${version}" done done