-->
- Apk Install Alpine Docker
- Alpine Apk Install Specific Version
- Apk Install Git Alpine
- Apk Install File Alpine
- Apk Install Python Alpine
This article describes how to install .NET on Alpine. When an Alpine version falls out of support, .NET is no longer supported with that version. However, these instructions may help you to get .NET running on those versions, even though it isn't supported.
A minimal Docker image based on Alpine Linux with a complete package index and only 5 MB in size! When Alpine Linux is first installed by default it comes with the user root with no password set so the first step after boot into alpine fresh install are set a password to the user root, if during install was run setup-alpine to change root password, that will be already assigned and can be changed with those setup steps described here. Alpine Linux uses the OpenRC init system to start services. Don't confuse OpenRC init with our system init (the first process that is executed aka pid 1). Many of the current init.d script found in Alpine Linux are taken from Gentoo. If you want to save time you could search Gentoo's repository for an existing initscript for your service. Install curl on Alpine Linux from the command line: # apk -no-cache add curl. To install curl in Alpine-based Docker image, add the following line to a Dockerfile: RUN apk -no-cache add curl. Alpine Linux 3.3 and heigher: The -no-cache option has been added in Alpine Linux 3.3. It allows to install packages with an index that is updated.
Install the SDK (which includes the runtime) if you want to develop .NET apps. Or, if you only need to run apps, install the Runtime. If you're installing the Runtime, we suggest you install the ASP.NET Core Runtime as it includes both .NET and ASP.NET Core runtimes.
If you've already installed the SDK or Runtime, use the dotnet --list-sdks
and dotnet --list-runtimes
commands to see which versions are installed. For more information, see How to check that .NET is already installed.
Install
Installers aren't available for Alpine Linux. You must install .NET in one of the following ways:
Supported distributions
The following table is a list of currently supported .NET releases and the versions of Alpine they're supported on. These versions remain supported until either the version of .NET reaches end-of-support or the version of Alpine reaches end-of-life.
Apk Install Alpine Docker
- A ✔️ indicates that the version of Alpine or .NET is still supported.
- A ❌ indicates that the version of Alpine or .NET isn't supported on that Alpine release.
- When both a version of Alpine and a version of .NET have ✔️, that OS and .NET combination is supported.
Alpine | .NET Core 2.1 | .NET Core 3.1 | .NET 5.0 |
---|---|---|---|
✔️ 3.13 | ✔️ 2.1 | ✔️ 3.1 | ✔️ 5.0 |
✔️ 3.12 | ✔️ 2.1 | ✔️ 3.1 | ✔️ 5.0 |
✔️ 3.11 | ✔️ 2.1 | ✔️ 3.1 | ✔️ 5.0 |
✔️ 3.10 | ✔️ 2.1 | ✔️ 3.1 | ❌ 5.0 |
❌ 3.9 | ✔️ 2.1 | ✔️ 3.1 | ❌ 5.0 |
❌ 3.8 | ✔️ 2.1 | ✔️ 3.1 | ❌ 5.0 |
The following versions of .NET are no longer supported. The downloads for these still remain published:
- 3.0
- 2.2
- 2.0
Dependencies
.NET on Alpine Linux requires the following dependencies installed:
- bash
- icu-libs
- krb5-libs
- libgcc
- libgdiplus (if the .NET app requires the System.Drawing.Common assembly)
- libintl
- libssl1.1 (Alpine v3.9 or greater)
- libssl1.0 (Alpine v3.8 or lower)
- libstdc++
- zlib
To install the needed requirements, run the following command:
To install libgdiplus, you may need to specify a repository:
Next steps
This material is work-in-progress ... Do not follow instructions here until this notice is removed. |
- 2Minimal Templates
- 4start, stop, restart functions
Introduction
Alpine Apk Install Specific Version
Alpine Linux uses the OpenRC init system to start services. Don't confuse OpenRC init with our system init (the first process that is executed aka pid 1). Many of the current init.d script found in Alpine Linux are taken from Gentoo. If you want to save time you could search Gentoo's repository for an existing initscript for your service. You can also check Gentoo's wiki for some additional OpenRC information.
NOTE: OpenRC recently added documentation on how to write proper Init scripts. Make sure you read it!
Apk Install Git Alpine
If you cannot find an init.d script from Gentoo, or you just want to start to write your own init.d scripts, we provide you with some basic information on how to write simple OpenRC init scripts.
Primary information about the OpenRC format can be found in the OpenRC man page openrc-run.
Minimal Templates
Every init.d script you write needs to start with a shebang like:
#!/sbin/openrc-run
Services relying on OpenRC exclusively
Services supervised by s6
Notes:
- Install and configure the
s6-scan
service to start on system boot - Exclude
start()
,stop()
andstatus()
functions in order for s6 supervision to work reliably. OpenRC has built-in equivalent functions which invoke the necessary s6 commands. - Include a
depend()
stanza to ensure that thes6-svscan
service is already running. - Add a
start_pre()
stanza to symlink the service directory into the scan directory, because the/etc/init.d/bootmisc
scripts cleans out the/run
directory on system boot.
Apk Install File Alpine
The rest of the below basic example could be omitted, but that would most probably leave you with an non working initd script.
Basic example
start, stop, restart functions
OpenRC defined a few basic functions ie: start, stop, restart. These functions are defined by default but can be overwritten by defining your own set of functions.This is generally only necessary if you want to do something special which is not provided by the default start/stop/restart implementations.
start
stop
Apk Install Python Alpine
restart
Daemon, Forking, Logging
TODO...