SpecialFolder.ApplicationData is blank inside of an Alpine docker container #69362
-
I'm doing this in a .NET 6.0 C# console CLI application: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); This returns a blank string when I run inside of a docker container created with FROM alpine
ENV HOME=/config
ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/tmp/.net
ENV CONFIG_FILE="/config/recyclarr.yml"
ENV CRON_SCHEDULE_SONARR="@daily"
ENV CRON_SCHEDULE_RADARR="@daily"
RUN apk add --no-cache libstdc++ icu
COPY --chmod=544 --from=build /build/recyclarr /usr/local/bin
COPY --chmod=544 entrypoint.sh /
VOLUME /config
ENTRYPOINT ["/entrypoint.sh"] I build my executable using this command: dotnet publish src\Recyclarr `
--output publish\linux-musl-x64 `
--configuration Release `
--runtime linux-musl-x64 `
--self-contained true Relevant msbuild settings: <PropertyGroup>
<PublishSingleFile>true</PublishSingleFile>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
<PublishReadyToRunShowWarnings>true</PublishReadyToRunShowWarnings>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup> I verified in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Looks like you may just need to set some environment variables, probably Additionally, although this wouldn't necessarily set the variables by default, you should be creating and using a non-root user in your containers. |
Beta Was this translation helpful? Give feedback.
Looks like you may just need to set some environment variables, probably
XDG_DATA_HOME
or similar.Additionally, although this wouldn't necessarily set the variables by default, you should be creating and using a non-root user in your containers.