can't compile F# projects on microsoft/dotnet:2.1-sdk-alpine (bash dependency)
See original GitHub issueSteps to reproduce
docker run --rm microsoft/dotnet:2.1-sdk-alpine /usr/share/dotnet/sdk/2.1.301/FSharp/RunFsc.sh
Expected behavior
The F# compiler runs on published SDK image. A couple of simple solutions are:
- install
bash
on the Alpine SDK image - change the shell script to not be bash specific
docker run --rm microsoft/dotnet:2.1-sdk-alpine sh /usr/share/dotnet/sdk/2.1.301/FSharp/RunFsc.sh
/usr/share/dotnet/sdk/2.1.301/FSharp/RunFsc.sh: line 9: syntax error: bad substitution
Actual behavior
env: can't execute 'bash': No such file or directory
I can’t build any F# projects without installing bash
first. Workaround:
docker run --rm microsoft/dotnet:2.1-sdk-alpine sh -c "apk update; apk add bash; /usr/share/dotnet/sdk/2.1.301/FSharp/RunFsc.sh"
Environment data
dotnet --info
output:
cc @KevinRansom
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:14 (10 by maintainers)
Top Results From Across the Web
Install the .NET SDK or the .NET Runtime on Alpine
NET is supported on Alpine and this article describes how to install . ... To install the .NET SDK, run the following command:...
Read more >Running ASP.NET Core in an Alpine Linux Docker Container
The error here is that the debian docker image we are using doesn't have the nightly version of the 2.1 runtime installed and...
Read more >alpine docker image with dotnet doesn't see my app
I found the problem. Alpine Linux uses musl c library and it makes standard dotnet build incompatible with this linux distro.
Read more >Building, running, and managing containers
Red Hat Enterprise Linux 8 provides a number of command-line tools for working with container images. You can manage pods and container images...
Read more >BusyBox.net
Some parts won't compile (not all kernel headers are present, libc API different or incomplete, etc). The maximal config which did compile is...
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
@livarcocc, can you point to those scripts in roslyn? I think it used to be through scripts, RunCsc and RunVb, but not anymore?
@svick, we don’t need to write in Almquist shell Alpine. If the scripts are written in Unix/Bourne Shell with shebang
#!/usr/bin/env sh
, that just works in all distros of BSD, Linux, Mac, Solaris.That is one of the reasons why many utilities out there such as
npm
use Unix/Bourne shell instead of bash. In .NET repos, bashism is a normal trait probably because it saves 10-15 minutes of figuring-out and coding time from devs who are new to Unix shells. It is also really a very poor excuse to shove bash down the throats of all consumers, even those who made a choice to use other shells. So please, do consider spending some time and updating the scripts (at least those that are shipped with product and related to runtime) to the common denominator, Unix Shell.This is really a thing to invest time on when you have widespread library/product. There are people in .NET who are trying to reduce amount of dependencies, this could be categories under that epic.
Then there are scripts under github.com/dotnet, that are fully Unix Shell compatible, but yet having
bash
shebang on the top… This shows lack of interest/awareness.At least effort could be started by avoiding bash in new scripts (in dotnet/arcade for example)…
re: https://github.com/Microsoft/omi/issues/497
cc @Petermarcu, @weshaggard
We want the
2.1-runtime-alpine
as slim as possible. We don’t care if2.1-sdk-alpine
grows in size to accommodate a bash install. We do want the tools to work out of the box. Please add bash to the sdk until product removes it is a dependency.