Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Support Alpine Linux #833

Closed
3 of 5 tasks
natemcmaster opened this issue Jan 31, 2018 · 11 comments
Closed
3 of 5 tasks

Support Alpine Linux #833

natemcmaster opened this issue Jan 31, 2018 · 11 comments
Assignees
Labels

Comments

@natemcmaster
Copy link
Contributor

natemcmaster commented Jan 31, 2018

All of our native dependencies need to also be updated to support musl instead of glibc.

We also need to generate an aspnetcore-runtime tarball for Alpine.

  • Upgrade SQLitePclRaw
  • Upgrade libuv Deferred until 2.2. See Support Alpine linux libuv-package#23
  • Add functional tests for Alpine
  • Update CI to produce an Alpine configuration
  • Update dotnet/CLI to consume
@muratg
Copy link

muratg commented Feb 27, 2018

SQLLitePCL.raw seems to be ready. libuv-package task is assigned to @natemcmaster.

@glennc You had some concerns about this. Could you elaborate? Tentatively putting this in the milestone so that we don't lose track of it.

@natemcmaster
Copy link
Contributor Author

I believe @bricelam is currently assigned to pull in a new SQLitePCL.raw package for a separate reason. We can use dotnet/efcore#10724 to track that update.

@natemcmaster
Copy link
Contributor Author

I've been poking at this for the last few days. The biggest challenge to implementing this at the moment is crossgen-ing the shared framework. This is difficult because

  1. Installing dotnet via dotnet-install.sh into Alpine doesn't work yet. https://github.com/dotnet/cli/issues/8738 We can workaround for now by using curl/tar.
  2. MSBuild cannot compile a .csproj inside an Alpine container. ResolveAssemblyReference fails in invariant mode on Alpine linux with error MSB3095 dotnet/msbuild#3066
  3. You can't run crossgen for Alpine on an Ubuntu machine because Ubuntu does not support the required libraries for musl-libc.

So, options:

  1. Skip crossgen for now on Alpine Linux. (@DamianEdwards is this acceptable for a preview?)
  2. Run crossgen without MSBuild. We could write MSBuild targets that generate shell scripts, but this must execute on an Ubuntu or Windows agent. Then, copy those scripts and files so crossgen can run inside a Docker container. (cc @JunTaoLuo )

@DamianEdwards
Copy link
Member

How are they doing it for MS.NETCore.App?

@natemcmaster
Copy link
Contributor Author

As far as I can tell, they are able to run the entire build inside an Alpine container. It's possible they are using a version of MSbuild that doesn't have this RAR bug: dotnet/msbuild#3066 or that they don't compile any .csproj files in their build (that seems unlikely)

@natemcmaster
Copy link
Contributor Author

I'm going to mark this as blocked for now on dotnet/msbuild#3066. It seems like dotnet/msbuild#3066 is critical enough (you can't even compile dotnet new console in Alpine) 🤞 it should get fixed.

@natemcmaster natemcmaster removed the blocked Blocked label Mar 10, 2018
@natemcmaster
Copy link
Contributor Author

Unblocked. Found workarounds for now. It turns out MSBuild does not like .NET Core's invariant mode on Alpine :(. That can be worked around by installing libicu in the docker container.

@muratg
Copy link

muratg commented Mar 10, 2018

@natemcmaster will that be in the .NET image as well, or just ours?

@natemcmaster
Copy link
Contributor Author

For now, it's a workaround so we can build the shared framework. It may not be necessary to use the shared framework.

Setting invariant mode by default in the microsoft/aspnetcore docker image is a separate question we should address with Rich, Michael, and Glenn. At the moment, I'm inclined to give invariant mode a shot so we can figure out what the problems will be. But it may not be a sensible default for customers.

@natemcmaster
Copy link
Contributor Author

So, I looked at this myself. To disable invariant mode, a users needs to add this to their dockerfile.

RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8

icu-libs adds 30.4 MB to the image.

@natemcmaster
Copy link
Contributor Author

Nightly builds for Alpine should be available on Docker Hub soon. aspnet/aspnet-docker#390

Closing as remaining work listed in item description was punted to 2.2.0. Using aspnet/libuv-package#23 to track that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants