Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Install .NET Core 1.0 on Red Hat OpenShift Container Platform


Images are available for using .NET Core 1.0 on OpenShift Container Platform. See OpenShift Container Platform 3.3 Image Creation Guide for more details.

The .NET Core 1.0 software collection (rh-dotnetcore10) ships with the project.json build system (1.0.0-preview2 SDK). See the Known Issues in the .NET Core 1.0 Release Notes for details on installing this SDK on a non-RHEL system. Visual Studio 2017 dropped support for the project.json build system. Support for the msbuild/csproj build system will be added in the .NET Core 2.0 release.

2.1. Images

Image stream definitions for the .NET Core on Red Hat Enterprise Linux Source to Image (S2I) are now added during OpenShift Container Platform installations. The Red Hat Enterprise Linux 7 images are available through Red Hat’s subscription registry using the following command.

$ docker pull registry.access.redhat.com/dotnet/dotnetcore-10-rhel7
Copy to Clipboard Toggle word wrap

To use this image, you can either access it directly from image registries or push them into your OpenShift Container Platform Docker registry. You can also 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. See OpenShift Container Platform 3.4 Guide to Using Images for more information about using images.

See OpenShift Container Platform 3.3 Installation and Configuration for more information about Red Hat OpenShift Container Platform 3.3 and .NET Core.

2.2. Configuration

The .NET Core images support a number of environment variables to control the build behavior of your .NET Core application.

Note

You must set environment variables that control build behavior in the s2i build configuration or in the .s2i/environment file to make them available to the build steps.

Expand
Variable NameDescriptionDefault

DOTNET_STARTUP_PROJECT

Used to select the project to run. This must be the folder containing project.json

Current working directory

DOTNET_PUBLISH

Used to control whether the application should be built by executing dotnet build or dotnet publish. To publish the application, set the value to true. It is recommended to publish your application.

For backwards compatibility, the default is false. In the next major release, this variable will be removed and the builder will always publish the application.

DOTNET_ASSEMBLY_NAME

Used to select the assembly to run. This must not include the .dll extension. Set this to the output assembly name specified in project.json (name, buildOptions/outputName). For project.json, the assembly name defaults to the project.json parent folder. When project.json is at the context-dir, the parent folder name will be src. So, by default, this generates a src.dll assembly. Setting DOTNET_ASSEMBLY_NAME will cause:

* The assembly to be <DOTNET_ASSEMBLY_NAME>.dll * The application sources to be in subfolder DOTNET_ASSEMBLY_NAME in the deployed container.

The name of the DOTNET_STARTUP_PROJECT folder

DOTNET_RESTORE_SOURCES

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

DOTNET_NPM_TOOLS

Used to specify a list of NPM packages to install before building the application

Unset

DOTNET_TEST_PROJECTS

Used to specify the space-separated list of test projects to run. This must be folders containing project.json. dotnet test is invoked for each folder.

Unset

DOTNET_CONFIGURATION

Used to run the application in Debug or Release mode. This value should be either Release or Debug.

Release

ASPNETCORE_URLS

This variable is set to http://*:8080 to configure ASP.NET Core to use the port exposed by the image. It is not recommended to change this.

http://*:8080

HTTP_PROXY

Configures the HTTP proxy used when building and running the application

 

HTTPS_PROXY

Configures the HTTPS proxy used when building and running the application

 

NPM_MIRROR

Use a custom NPM registry mirror to download packages during the build process.

 
Note

Typical modern web applications rely on javascript tools to build the front end. The image includes npm (node package manager) to install these tools. Packages can be installed by setting DOTNET_NPM_TOOLS and by calling npm install in the build process.

2.3. Quickly Deploy Applications from .NET Core Source

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
Copy to Clipboard Toggle word wrap

Report a bug

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2026 Red Hat