immense / Remotely

A remote control and remote scripting solution, built with .NET 8, Blazor, and SignalR.
GNU General Public License v3.0
4.28k stars 1.6k forks source link

[Feature] Update Server Build to Include More Popular Arch/Platform #846

Open LanceMcCarthy opened 3 months ago

LanceMcCarthy commented 3 months ago

Is your feature request related to a problem? Please describe.

I did find several other issues mentioning missing ARM64 support, but they were referring to the agent. I would like to have the server hosted on arm64

The days of crappy Raspberry Pis are behind us, I have Portainer running a crap ton of services on a Pi4 8GB and it's blazingly fast.

Problem

If you try to deploy to such a host, you'd get the dreaded:

exec /usr/bin/dotnet: exec format error
exec /usr/bin/dotnet: exec format error
exec /usr/bin/dotnet: exec format error

As expected, attempting to spin up the stack result sin the bad exec error (I'm a .NET developer myself and I know this means there was no dockerbuild for linux/arm64/v8.

Describe the solution you'd like A server build for linux/arm64/v8

Fast Fix - Contribution Suggestion

[!note] I wouldn't go through the trouble of bothering you if I didn't at least bring something to the table, so here are the goodies...

If you would like a head start, I have many projects that I build for multiple architectures, including linux/arm64, and you can copy paste as a quick fix - here's one that I will use for reference because it is a perfect match to solve your problem and close 5 GitHub Issues at once

The .NET SDK gives you a HUGE head start here and will pass in $TARGETARCH and $BUILDPLATFORM as vars, just define them as ARGS. The best part is you can also use them to pull in the right base image from Microsoft!

Here is my multiplatform dockerfile, notice the use of buildplatform and targetarch throughout the commands.

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG TARGETARCH
ARG BUILDPLATFORM
WORKDIR '/src/SecretsMocker/SecretsMocker'
COPY . .
RUN dotnet restore -a $TARGETARCH
RUN dotnet build -a $TARGETARCH
RUN dotnet publish './SecretsMocker.csproj' -o /app/publish -a $TARGETARCH

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 as final
ARG BUILDPLATFORM
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["./SecretsMocker"]

and when you publish, tharr'she'is!

image

Edit > Cleaned up title (clicked open too fast), fixed sections layouts for easier reading.