diff --git a/.gitea/workflows/docker-builder.yml b/.gitea/workflows/docker-builder.yml index 9953e7a..9989486 100644 --- a/.gitea/workflows/docker-builder.yml +++ b/.gitea/workflows/docker-builder.yml @@ -170,39 +170,53 @@ jobs: - name: Build & push multiarch if: steps.check_files.outputs.should_build == 'true' + shell: bash run: | echo "== Multiarch Build Start ==" - # Build amd64 + # versions.env direkt hier laden + BASE_IMAGE=$(grep ^BASE_IMAGE= versions.env | cut -d '=' -f2-) + APP_VERSION=$(grep ^APP_VERSION= versions.env | cut -d '=' -f2-) + + echo "BASE_IMAGE=$BASE_IMAGE" + echo "APP_VERSION=$APP_VERSION" + + if [ -z "$BASE_IMAGE" ]; then + echo "BASE_IMAGE is empty → abort" + exit 1 + fi + + # amd64 build docker buildx build \ --platform linux/amd64 \ -f ${AMD64_DOCKERFILE} \ - --build-arg BASE_IMAGE=$BASE_IMAGE \ - --build-arg APP_VERSION=$APP_VERSION \ - --label org.opencontainers.image.version=$APP_VERSION \ - --label org.opencontainers.image.created=$BUILD_DATE \ + --build-arg BASE_IMAGE="$BASE_IMAGE" \ + --build-arg APP_VERSION="$APP_VERSION" \ + --label org.opencontainers.image.version="$APP_VERSION" \ + --label org.opencontainers.image.created="$BUILD_DATE" \ -t ${CACHE_IMAGE_NAME}:${VERSION}-amd64 \ --push . - # Build arm64 + # arm64 build docker buildx build \ --platform linux/arm64 \ -f ${ARM64_DOCKERFILE} \ - --build-arg BASE_IMAGE=$BASE_IMAGE \ - --build-arg APP_VERSION=$APP_VERSION \ - --label org.opencontainers.image.version=$APP_VERSION \ - --label org.opencontainers.image.created=$BUILD_DATE \ + --build-arg BASE_IMAGE="$BASE_IMAGE" \ + --build-arg APP_VERSION="$APP_VERSION" \ + --label org.opencontainers.image.version="$APP_VERSION" \ + --label org.opencontainers.image.created="$BUILD_DATE" \ -t ${CACHE_IMAGE_NAME}:${VERSION}-arm64 \ --push . - # Merge into manifest - docker buildx imagetools create -t ${IMAGE_NAME}:${VERSION} \ + docker buildx imagetools create \ + -t ${IMAGE_NAME}:${VERSION} \ ${CACHE_IMAGE_NAME}:${VERSION}-amd64 \ ${CACHE_IMAGE_NAME}:${VERSION}-arm64 echo "== Multiarch Build Complete ==" + - name: Generate SBOM run: | docker sbom ${IMAGE_NAME}:edge > sbom.spdx.json || true