.gitea/workflows/build-and-push.yaml aktualisiert
All checks were successful
/ release-and-build (push) Successful in 40s
All checks were successful
/ release-and-build (push) Successful in 40s
This commit is contained in:
@@ -135,26 +135,25 @@ jobs:
|
||||
|
||||
# Wir übergeben trotzdem ALLE Variablen als Build-Arg.
|
||||
# Docker ist schlau genug, nicht genutzte Args zu ignorieren.
|
||||
DOCKER_ARGS=""
|
||||
# WICHTIG: Bash-Array nutzen, um Leerzeichen (z.B. in DESCRIPTION) zu schützen!
|
||||
DOCKER_ARGS=()
|
||||
keys=$(grep -v '^#' buildargs.env | cut -d'=' -f1 | tr -d '\r')
|
||||
for k in $keys; do
|
||||
val="${!k}"
|
||||
DOCKER_ARGS="$DOCKER_ARGS --build-arg $k=$val"
|
||||
DOCKER_ARGS+=("--build-arg" "$k=$val")
|
||||
done
|
||||
|
||||
RESOLVED_BASE=$(echo $BASE)
|
||||
BASE_SHA=$(docker buildx imagetools inspect $RESOLVED_BASE --format '{{json .Manifest.Digest}}' 2>/dev/null | tr -d '"' || echo "unknown")
|
||||
|
||||
# WICHTIG: Wir speichern jetzt ZWEI Informationen im Label/Annotation
|
||||
|
||||
# AMD64 Build
|
||||
docker buildx build $DOCKER_ARGS --pull --platform linux/amd64 -f Dockerfile \
|
||||
# AMD64 Build (Beachte die Anführungszeichen um das Array: "${DOCKER_ARGS[@]}")
|
||||
docker buildx build "${DOCKER_ARGS[@]}" --pull --platform linux/amd64 -f Dockerfile \
|
||||
--label "pi_farm.base_digest=$BASE_SHA" \
|
||||
--label "pi_farm.args_hash=$ARGS_HASH" \
|
||||
-t $IMAGE:tmp-amd64 --push .
|
||||
|
||||
# ARM64 Build
|
||||
docker buildx build $DOCKER_ARGS --pull --platform linux/arm64 -f Dockerfile.aarch64 \
|
||||
docker buildx build "${DOCKER_ARGS[@]}" --pull --platform linux/arm64 -f Dockerfile.aarch64 \
|
||||
--label "pi_farm.base_digest=$BASE_SHA" \
|
||||
--label "pi_farm.args_hash=$ARGS_HASH" \
|
||||
-t $IMAGE:tmp-arm64 --push .
|
||||
|
||||
Reference in New Issue
Block a user