I've been running some parts of the *arr stack
on my hypervisor at home for quite some time now, but only recently did I
notice that they were packaged in
Alpine!
I trashed the container with all the carefully-deployed-by-hand binaries,
created a new one running Alpine
Edge, ran apk add sonarr
radarr prowlarr, and…
~ # apk add sonarr radarr prowlarr
ERROR: unable to select packages:
aspnetcore6-runtime (no such package):
required by: sonarr-4.0.16.2944-r0[aspnetcore6-runtime]
~ #
Urgh, the latest Sonarr release
(v4.0.16.2944),
is still running on .NET
6,
which isn't packaged anymore on Alpine Edge. Fortunately, one can do horribly
unsupported things like mixing
repositories,
and have a /etc/apk/repositories frankenfile looking like this:
https://dl-cdn.alpinelinux.org/alpine/edge/main
https://dl-cdn.alpinelinux.org/alpine/edge/community
https://dl-cdn.alpinelinux.org/alpine/edge/testing
@main319 https://dl-cdn.alpinelinux.org/alpine/v3.19/main
@community319 https://dl-cdn.alpinelinux.org/alpine/v3.19/community
Installing Sonarr can then be done with apk add sonar@community319
sonar-openrc@community319, launched via service sonarr start, and … it
crashes after a couple of seconds. Running service -d sonarr start tells us
that the binary being launched is /usr/lib/sonarr/bin/Sonarr, so let's see
what happens when we run it manually:
~ $ /usr/lib/sonarr/bin/Sonarr
You must install or update .NET to run this application.
App: /usr/lib/sonarr/bin/Sonarr
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '6.0.36' (x64)
.NET location: /usr/lib/dotnet
The following frameworks were found:
6.0.31 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
8.0.22 at [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=6.0.36&arch=x64&rid=alpine.3.23-x64&os=alpine
~ $
Alright, .NET version mismatch: we have 6.0.31 installed and the binary wants
6.0.36. The
DOTNET_ROLL_FORWARD
environment variable can be used to make a binary run on newer version of
the runtime, but not an older one. While we can't use 6.0.31, we have 8.0.22
installed for the rest of the *arr stack, so let's give it a try. Adding
DOTNET_ROLL_FORWARD=LatestMajor followed by export DOTNET_ROLL_FORWARD
in /etc/init.d/sonarr does the trick, and Sonarr is now working, huzzah!
Once Sonarr 5.X is
released, I'll simply remove the @community319/@main@319 lines from
/etc/apk/repositories and run apk update; apk upgrade to get the version
compiled for modern packaged .NET.