$ docker pull registry.access.redhat.com/dotnet/dotnetcore-10-rhel7 $ docker pull registry.access.redhat.com/dotnet/dotnetcore-11-rhel7
.NET Core is a general purpose development platform featuring automatic memory management and modern programming languages. It allows users to build high quality applications efficiently. .NET Core is available on Red Hat Enterprise Linux (RHEL 7) and OpenShift Container Platform via certified containers. .NET Core offers:
The ability to follow a microservices-based approach, where some components are built with .NET and others with Java, but all can run on a common, supported platform in Red Hat Enterprise Linux and OpenShift Container Platform.
The capacity to more easily develop new .NET Core workloads on Windows; customers are able to deploy and run on either Red Hat Enterprise Linux or Windows Server.
A heterogeneous data center, where the underlying infrastructure is capable of running .NET applications without having to rely solely on Windows Server.
Access to many of the popular development frameworks such as .NET, Java, Ruby, and Python from within OpenShift Container Platform.
.NET Core version 1.0
.NET Core version 1.1
Supported on Red Hat Enterprise Linux (RHEL) 7 and OpenShift Container Platform versions 3.3 and later
Image stream definitions for the .NET Core on RHEL S2I image are now added during OpenShift Container Platform installations.
The RHEL 7 images are available through Red Hat’s subscription registry using:
$ docker pull registry.access.redhat.com/dotnet/dotnetcore-10-rhel7 $ docker pull registry.access.redhat.com/dotnet/dotnetcore-11-rhel7
To use these images, you can either access them directly from these image registries, or push them into your OpenShift Container Platform Docker registry. Additionally, you can create an image stream that points to the image, either in your Docker registry or at the external location. Your OpenShift Container Platform resources can then reference the image stream definition.
The .NET Core images support a number of environment variables, which you can set to control the build behavior of your .NET Core application.
You must set environment variables that control build behavior in the S2I build configuration or in the .s2i/environment file in order to make them available to the build steps. |
Variable Name | Description | Default |
---|---|---|
|
Used to select the project to run. This must be the folder in the source repository containing project.json. |
. |
|
Used to control whether the application should be built by executing |
For backwards compatibility, the
default is In the next major release, this variable will be removed and the builder will always publish the application. |
|
Used to select the assembly to run. This must not include the
|
The name of the |
|
Used to specify the space-separated list of NuGet package sources used during the restore operation. This overrides all of the sources specified in the NuGet.config file. |
Unset |
|
Used to specify a list of NPM packages to install before building the application. |
Unset |
|
Used to specify the space-separated list of test projects to run. This must be folders containing
project.json. |
Unset |
|
Used to run the application in |
|
|
This variable is set to |
|
The .NET image stream must first be installed. If you ran a standard installation, the image stream will be present. |
An image can be used to build an application by running oc new-app
against a
sample repository:
$ oc new-app registry.access.redhat.com/dotnet/dotnetcore-10-rhel7~https://github.com/redhat-developer/s2i-dotnetcore-ex#dotnetcore-1.0 --context-dir=app $ oc new-app registry.access.redhat.com/dotnet/dotnetcore-11-rhel7~https://github.com/redhat-developer/s2i-dotnetcore-ex#dotnetcore-1.1 --context-dir=app
The |
The .NET image templates and the .NET images streams must first be installed. If you ran a standard installation, the templates and image streams will be present. This can be checked with: $ (oc get -n openshift templates; oc get -n openshift is) | grep dotnet |
OpenShift Container Platform includes templates for the .NET Core images to help easily deploy a sample application.
The .NET Core sample
application running on dotnet/dotnetcore-10-rhel7
can be deployed with:
$ oc new-app --template dotnet-example
The .NET Core sample
application running on dotnet/dotnetcore-11-rhel7
can be deployed with:
$ oc new-app --template dotnet-example -p DOTNET_IMAGE_STREAM_TAG=dotnet:1.1 -p SOURCE_REPOSITORY_REF=dotnetcore-1.1
The .NET Core MusicStore application using PostgreSQL as database can be deployed with:
$ oc new-app --template=dotnet-pgsql-persistent