Skip to content

scripts: update installscript.sh to detect musl and default to non-self-contained version - #627

Merged
embetten merged 2 commits into
masterfrom
users/embetten/musl-detection
Jan 26, 2026
Merged

embetten merged 2 commits into
masterfrom
users/embetten/musl-detection

Conversation

@embetten

@embetten embetten commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

For #621

In 2.0.0 we updated the install scripts to default to the self-contained version if we were able to detect a supported runtime and architecture. If a non-supported os and architechture, we would default to the non self-contained version. For linux, This change did not take linux musl into account - which would require shipping supported self-contained versions linux-musl-x64 and linux-musl-arm64 where we are only shipping linux-x64 and linux-arm64.

This proposed change attempts to detect if a linux machine uses musl instead of glibc, and if true, treat it like a non-supported platform and install the non self-contained netcore version.

sample dockerfile on alpine with successful build for his branch

FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env

## dont use this script directly outside of testing this pr branch
RUN wget -qO- https://raw.githubusercontent.com/microsoft/artifacts-credprovider/refs/heads/users/embetten/musl-detection/helpers/installcredprovider.sh | sh

ARG FEED_URL
ARG FEED_ACCESSTOKEN

# Optional: Sometimes the http client hangs because of a .NET issue. Setting this in dockerfile helps 
ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"$FEED_URL\",\"username\":\"docker\",\"password\":\"$FEED_ACCESSTOKEN\"}]}"

WORKDIR /app

RUN dotnet new console
RUN dotnet new nugetconfig
RUN dotnet nuget remove source nuget
RUN dotnet nuget add source $FEED_URL -n embettenTest --configfile ./nuget.config
RUN dotnet add package Microsoft.Identity.Client.Extensions.Msal --version 4.77.1
RUN dotnet restore --verbosity detailed

@embetten embetten changed the title Users/embetten/musl detection scripts: update installscript.sh to detect musl and default to non-self-contained version Jan 23, 2026
@embetten
embetten merged commit 912de7b into master Jan 26, 2026
55 checks passed
@embetten
embetten deleted the users/embetten/musl-detection branch January 26, 2026 18:21
embetten added a commit that referenced this pull request Jan 29, 2026
…lf-contained version (#627)

For #621 

In 2.0.0 we updated the install scripts to default to the self-contained
version if we were able to detect a supported runtime and architecture.
If a non-supported os and architechture, we would default to the non
self-contained version. For linux, This change did not take linux musl
into account - which would require shipping supported self-contained
versions `linux-musl-x64` and `linux-musl-arm64` where we are only
shipping linux-x64 and linux-arm64.

This proposed change attempts to detect if a linux machine uses musl
instead of glibc, and if true, treat it like a non-supported platform
and install the non self-contained netcore version.


sample dockerfile on alpine with successful build for his branch
```
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build-env

## dont use this script directly outside of testing this pr branch
RUN wget -qO- https://raw.githubusercontent.com/microsoft/artifacts-credprovider/refs/heads/users/embetten/musl-detection/helpers/installcredprovider.sh | sh

ARG FEED_URL
ARG FEED_ACCESSTOKEN

# Optional: Sometimes the http client hangs because of a .NET issue. Setting this in dockerfile helps 
ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
ENV VSS_NUGET_EXTERNAL_FEED_ENDPOINTS="{\"endpointCredentials\": [{\"endpoint\":\"$FEED_URL\",\"username\":\"docker\",\"password\":\"$FEED_ACCESSTOKEN\"}]}"

WORKDIR /app

RUN dotnet new console
RUN dotnet new nugetconfig
RUN dotnet nuget remove source nuget
RUN dotnet nuget add source $FEED_URL -n embettenTest --configfile ./nuget.config
RUN dotnet add package Microsoft.Identity.Client.Extensions.Msal --version 4.77.1
RUN dotnet restore --verbosity detailed
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants