From 1b4d9fedd5c18dc781a956ee4e4f3987238acf7e Mon Sep 17 00:00:00 2001 From: pi-farm Date: Sat, 27 Sep 2025 20:53:10 +0200 Subject: [PATCH] edit function build_image --- scripts/image-builder.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/image-builder.sh b/scripts/image-builder.sh index 9d03f3a..dfb569b 100755 --- a/scripts/image-builder.sh +++ b/scripts/image-builder.sh @@ -632,7 +632,7 @@ build_image() { echo "====================================" } | tee "$logfile" - # Architekturen in Buildx-Format umwandeln (linux/arch, durch Komma getrennt) + # Architekturen in Buildx-Format umwandeln (linux/arch, getrennt durch Komma) local platforms platforms=$(echo "$architectures" | xargs -n1 | sed 's|^|linux/|' | paste -sd, -) @@ -641,23 +641,21 @@ build_image() { IFS=',' read -ra regs <<< "$registry" for reg in "${regs[@]}"; do tags+=("-t" "${reg}/${image_name}:${version}") - [[ "$latest" == "yes" ]] && tags+=("-t" "${reg}/${image_name}:latest") + if [[ "$latest" == "yes" ]]; then + tags+=("-t" "${reg}/${image_name}:latest") + fi done - # Push oder Load Flag - local driver_flag="" - if [[ "$push" == "yes" ]]; then - driver_flag="--push" - else - driver_flag="--load" - fi + # Push-Flag + local push_flag="" + [[ "$push" == "yes" ]] && push_flag="--push" { docker buildx build \ --platform "$platforms" \ "${tags[@]}" \ "$PROJECTS_DIR/$project" \ - $driver_flag + $push_flag } 2>&1 | tee -a "$logfile" echo "==== Build beendet: $(date) ====" | tee -a "$logfile"