Single-file builds incur a performance cost. Mainly because the runtime must extract the contents of the C# application to a temp directory in order for it to run. In a Docker container, single-file offers no tangible benefit because the user isn't interacting directly with those files. To gain some performance improvement, single-file is disabled for MUSL builds. Furthermore, the docker image is reconfigured to place the Recyclarr binary files in a different directory. Previously, as a single-file binary, it was placed in the container at `/usr/local/bin`, but now that it is a multiple-file application, it now lives in `/app/recyclarr`.pull/108/head
parent
3a5e1f0c5e
commit
72b0c9272d
@ -1,18 +1,26 @@
|
||||
[CmdletBinding()]
|
||||
param (
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string] $runtime
|
||||
[string] $runtime,
|
||||
[Parameter()]
|
||||
[switch] $noSingleFile
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (-not $noSingleFile) {
|
||||
$singleFileArgs = @(
|
||||
"--self-contained=true"
|
||||
"-p:PublishSingleFile=true"
|
||||
"-p:IncludeNativeLibrariesForSelfExtract=true"
|
||||
"-p:PublishReadyToRunComposite=true"
|
||||
"-p:PublishReadyToRunShowWarnings=true"
|
||||
"-p:EnableCompressionInSingleFile=true"
|
||||
)
|
||||
}
|
||||
|
||||
dotnet publish src\Recyclarr `
|
||||
--output publish\$runtime `
|
||||
--configuration Release `
|
||||
--runtime $runtime `
|
||||
--self-contained true `
|
||||
-p:PublishSingleFile=true `
|
||||
-p:IncludeNativeLibrariesForSelfExtract=true `
|
||||
-p:PublishReadyToRunComposite=true `
|
||||
-p:PublishReadyToRunShowWarnings=true `
|
||||
-p:EnableCompressionInSingleFile=true
|
||||
$singleFileArgs
|
||||
|
@ -1,8 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
# Do not shallow clone because gitversion needs history!
|
||||
git clone -b $BUILD_FROM_BRANCH "https://github.com/$REPOSITORY.git" source
|
||||
cd source
|
||||
|
||||
pwsh ./ci/Publish.ps1 $runtime
|
||||
cp ./publish/$runtime/recyclarr ..
|
||||
dotnet publish source/src/Recyclarr -o publish -c Release -r $runtime
|
||||
|
Loading…
Reference in new issue