dotnet-install.sh doesn't work on Alpine Linux v3.7
See original GitHub issueSteps to reproduce
docker run -it alpine:latest
# in container
apk update
apk add curl bash
curl -O https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh
chmod 777 dotnet-install.sh
./dotnet-install.sh
# errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue
apk add libunwind-dev openssl-dev icu-libs curl-dev
./dotnet-install.sh
# same errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue
Expected behavior
it installs dotnet.
Actual behavior
it doesn’t install dotnet.
Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs (although i can find all of these under /usr/bin). According to maintainers in alpine’s IRC channel (cc @ncopa), this script is not meant to locate the libs reliably (but its purpose is to create some symlinks). The correct way is to use scanelf -qS /usr/lib | grep libunwind
etc.
Workaround
Manually install dotnet from tarball as described here: https://github.com/PowerShell/PowerShell/pull/6367#issuecomment-372765035
Environment data
alpine linux 3.7
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
dotnet-install.sh doesn't work on Alpine Linux v3.7 #9171
Actual behavior. it doesn't install dotnet. Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs ( ...
Read more >jenkins - dotnet not found in alpine docker
When I use volumes in the yml file, seems like the dotnet sdk instalation is getting lost. When I don't use volumes, dotnet...
Read more >Install .NET 6 runtime on clean Alpine Linux - ag
I will start with a completely clean, stock Alpine distro. Install. Dependencies. Alpine does not have .NET 6 installers or sudo, ...
Read more >Install .NET on Linux without using a package manager
Demonstrates how to install the .NET SDK and the .NET Runtime on Linux without a package manager. Use the install script or manually...
Read more >How To Install Microsoft .NET Core SDK On Linux
NET SDK in Alpine Linux. To install .NET SDK in Alpine Linux, run: $ sudo apk add dotnet7-sdk. Install ASP.NET Core Runtime in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@omajid “Perhaps we should add a flag to dotnet-install.sh to not check for pre-requisites” - try “export DOTNET_INSTALL_SKIP_PREREQS=1”
@janvorli, for your info. I spent sometime chatting with Alpine packaging folks to know how they see ldconfig, they gave me the above mentioned pointers (with explanation from me). The proposal in the linked / duplicated issue can work, but IMO can be revised a bit based on how other products requiring ldconfig have managed to support Alpine. Thanks!