Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to build an ASP.NET Core 9 Blazor app and dockerise it for a 32-bit Raspberry Pi?

$
0
0

I've built an OSS app using Hosted Blazor WASM (.NET 9), which somebody wants to try on a Raspberry Pi. The app has been dockerised for simple deployment, and I'm using the build-push-action in Github Actions (per this link) to build it and push to Docker Hub.

So in my Dockerfile I have:

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0 AS baseWORKDIR /appFROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS publishWORKDIR /srcCOPY . .WORKDIR "/src"ARG TARGETARCHARG VERSIONRUN dotnet publish MyProject.csproj -a $TARGETARCH -c Release --self-contained true          -p:PublishTrimmed=false --property:PublishDir=/app/publish /p:Version=$VERSIONFROM base AS finalWORKDIR /appCOPY --from=publish /app/publish .ENTRYPOINT ["/app/MyProject", "/appdata"]

and in the Github action I have:

     # Github setup etc... then:     - name: Build/push develop        if: github.ref == 'refs/heads/develop'        uses: docker/build-push-action@v6        with:          push: true          build-args: VERSION=1.0.${{ github.run_number }}-dev          platforms: linux/arm64, linux/amd64, darwin, linux/arm/v7, linux/arm/v6, linux/arm/v5          tags: mydockerrepo/myimage:dev

However, when the user tries to run the app on their RPi, they get this error:

exec /app/MyProject: no such file or directory

The RPi is returning this for the OS type:

blah@raspberrypi:~ $ uname -marmv7l

The docker image works just fine on other OSes (Mac, Linux etc), so I think there's something missing here in terms of the platforms to publish to. What should I pass for a 32bit ARM platform and target architecture? I've gone through pages and pages of docs, but can't seem to find the answer. The challenge here is that I don't have an RPi to test on, and the person who does isn't a developer...


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>