edit function build_image
This commit is contained in:
@@ -632,7 +632,7 @@ build_image() {
|
|||||||
echo "===================================="
|
echo "===================================="
|
||||||
} | tee "$logfile"
|
} | tee "$logfile"
|
||||||
|
|
||||||
# Architekturen in Buildx-Format umwandeln (linux/arch, durch Komma getrennt)
|
# Architekturen in Buildx-Format umwandeln (linux/arch, getrennt durch Komma)
|
||||||
local platforms
|
local platforms
|
||||||
platforms=$(echo "$architectures" | xargs -n1 | sed 's|^|linux/|' | paste -sd, -)
|
platforms=$(echo "$architectures" | xargs -n1 | sed 's|^|linux/|' | paste -sd, -)
|
||||||
|
|
||||||
@@ -641,23 +641,21 @@ build_image() {
|
|||||||
IFS=',' read -ra regs <<< "$registry"
|
IFS=',' read -ra regs <<< "$registry"
|
||||||
for reg in "${regs[@]}"; do
|
for reg in "${regs[@]}"; do
|
||||||
tags+=("-t" "${reg}/${image_name}:${version}")
|
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
|
done
|
||||||
|
|
||||||
# Push oder Load Flag
|
# Push-Flag
|
||||||
local driver_flag=""
|
local push_flag=""
|
||||||
if [[ "$push" == "yes" ]]; then
|
[[ "$push" == "yes" ]] && push_flag="--push"
|
||||||
driver_flag="--push"
|
|
||||||
else
|
|
||||||
driver_flag="--load"
|
|
||||||
fi
|
|
||||||
|
|
||||||
{
|
{
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "$platforms" \
|
--platform "$platforms" \
|
||||||
"${tags[@]}" \
|
"${tags[@]}" \
|
||||||
"$PROJECTS_DIR/$project" \
|
"$PROJECTS_DIR/$project" \
|
||||||
$driver_flag
|
$push_flag
|
||||||
} 2>&1 | tee -a "$logfile"
|
} 2>&1 | tee -a "$logfile"
|
||||||
|
|
||||||
echo "==== Build beendet: $(date) ====" | tee -a "$logfile"
|
echo "==== Build beendet: $(date) ====" | tee -a "$logfile"
|
||||||
|
|||||||
Reference in New Issue
Block a user