Docker + Alpine Linux - AspNetCore.SassCompiler.targets(11,5): error : Error running sass compiler:
See original GitHub issueI have edited this issue now that I have done some more research and have create a bare repository to help demo the issue:
The issue seems to be when building with an Alpine Linux Docker image with AspNetCore.SassCompiler.
If you inherit from the usual FROM mcr.microsoft.com/dotnet/sdk:6.0
Ubuntu image then all builds and works as normal however if you inherit from the Alpine version FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine
then you get build errors such as:
#14 0.508 Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
#14 0.508 Copyright (C) Microsoft Corporation. All rights reserved.
#14 0.508
#14 2.574 /root/.nuget/packages/aspnetcore.sasscompiler/1.52.3/build/AspNetCore.SassCompiler.targets(11,5): error : Error running sass compiler: [/source/aspnetcore-alpine-sass.csproj]
#14 2.574 /root/.nuget/packages/aspnetcore.sasscompiler/1.52.3/build/AspNetCore.SassCompiler.targets(11,5): error : . [/source/aspnetcore-alpine-sass.csproj]
#14 5.668 aspnetcore-alpine-sass -> /source/bin/release/net6.0/linux-musl-x64/aspnetcore-alpine-sass.dll
#14 5.732 aspnetcore-alpine-sass -> /app/
------
executor failed running [/bin/sh -c dotnet publish -c release -o /app -r linux-musl-x64 --no-self-contained --no-restore]: exit code: 1
I think it may have something to do with dart sass itself.
I have created a repo to demonstrate the bug and have a little more info in the readme.md over there.
https://github.com/solrevdev/aspnetcore-alpine-sass
Desktop (please complete the following information):
OS: 64bit Mac OS X 10.15.7 19H1922
Kernel: x86_64 Darwin 19.6.0
Uptime: 2h 43m
Packages: 547
Shell: zsh 5.9
Resolution: 1920x1080
DE: Aqua
WM: Quartz Compositor
WM Theme: Blue
Disk: 11G / 480G (5%)
CPU: Intel Core i7-3615QM @ 2.30GHz
GPU: Intel HD Graphics 4000
RAM: 8217MiB / 16384MiB
dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.300
Commit: 8473146e7d
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/6.0.300/
Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6
.NET SDKs installed:
3.1.419 [/usr/local/share/dotnet/sdk]
6.0.300 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.25 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.25 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
Alpine linux support still not fully working #1868
I upgraded to the latest version as introduced Alpine linux support in #1589. Building Alpine linux docker container and running yarn install ...
Read more >Issue to node-sass and Docker
I have a similar error, only when I run the docker container on a Linux machine, in MAC is working perfect!! I think...
Read more >AspNetCore.SassCompiler 1.49.4
Sass Compiler Library for .NET Core 3.1/5.x/6.x. without node, using dart-sass as a compiler.
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 >Sass building for prod in container - Elixir Forum
It works on my machine. I added DartSass to my project. However when attempting to build it in a Docker container for release,...
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
Thanks @a-van-rooyen for your
glibc-2.34-r0.apk
fix.Very interesting!
So that didn’t work for me yet your 3 lines compiled. Yours uses
glibc-2.34-r0.apk
whereas I grabbed from the source siteglibc-2.35-r0.apk
https://github.com/CargoSense/dart_sass#compatibility-with-alpine-linux-mix-sass-default-exited-with-2 verses https://github.com/sgerrand/alpine-pkg-glibc#installing
See my comments