Skip to content
.NET Core OpenShift images
Branch: master
Clone or download
aslicerh RHEL 8 Support (#275)
* Adjust content sets for rhel8 support.

* Add RHEL8 Dockerfile, add RHEL8 to tests and build script.

* Update Dockerfiles and tests for new dotnet versions, which include:

1.0.16
1.1.13
2.1.11 runtime
2.1.11 ASP.NET Core
2.1.507 SDK
2.2.5 runtime
2.2.5 ASP.NET Core
2.2.107 SDK

* Update readme for building RHEL8 images.

* Update Centos expected versions in tests.

* Update rhel8 expected versions to the latest available.
Latest commit 9c5315e May 24, 2019

README.md

.NET Core Docker Image

This repository contains the source for building .NET Core apps as reproducible Docker images using source-to-image. The resulting image can be run using Docker.

Versions

.NET Core versions currently provided are:

  • 1.0 (RHEL 7, CentOS 7)
  • 1.1 (RHEL 7)
  • [RETIRED] 2.0 (RHEL 7, CentOS 7)
  • 2.1 (RHEL 7, RHEL 8, CentOS 7)
  • 2.2 (RHEL 7, CentOS 7)

Building

$ git clone https://github.com/redhat-developer/s2i-dotnetcore.git
$ sudo VERSIONS=2.2 ./build.sh

Note: to build RHEL 7 based images, you need to run the build on a properly subscribed RHEL 7 machine. On RHEL 8 systems, RHEL 8 images are built by default. On non-RHEL, building CentOS images is the default.

To override the default basis of the image, set IMAGE_OS to the desired base system, such as IMAGE_OS=CENTOS or IMAGE_OS=RHEL8.

Installing

The Red Hat documentation for .NET Core describes the steps to install the image streams.

This repo contains a bash script that performs these steps.

For example, to install the rhel7 based images and add a secret for authenticating against the registry.redhat.io registry:

$ wget https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/install-imagestreams.sh
$ chmod +x install-imagestreams.sh
$ ./install-imagestreams.sh --os rhel7 -u <subscription_username> -p <subscription_password>

Run ./install-imagestreams.sh --help for more information.

Usage

For information about usage of Docker image for .NET Core 2.2, see 2.2 builder usage documentation and 2.2 runtime usage documentation.

For information about usage of Docker image for .NET Core 2.1, see 2.1 builder usage documentation and 2.1 runtime usage documentation.

For information about usage of Docker image for .NET Core 2.0, see 2.0 builder usage documentation and 2.0 runtime usage documentation.

For information about usage of Docker image for .NET Core 1.1, see 1.1 usage documentation.

For information about usage of Docker image for .NET Core 1.0, see 1.0 usage documentation.

Image name structure

Structure: dotnet/1-2-3
  1. Platform name: 'dotnetcore' for 1.x, 'dotnet' for 2.0+
  2. Platform version (without dots)
  3. Base image: 'rhel7' or 'centos7'

Examples: dotnet/dotnetcore-10-rhel7, dotnet/dotnet-20-centos7

OpenShift Templates

The templates folder contains OpenShift templates. Some of these will be shipped with OpenShift. Templates under the templates/community folder are provided and maintained by the community. They are not supported or kept up-to-date by the maintainers of this repository and may fail when used with newer versions of .NET Core.

If a template is not on your OpenShift installation, you can import it:

oc create -f <template.json>

To instantiate a template you can use the oc new-app command:

oc new-app --template=<template>

The template can also be instantiated using the OpenShift web console. Login to the console and navigate to the desired project. Click the Add to Project button. Search and select the desired template by it's name (e.g. dotnet-example). Next, click Create to start a build and deploy the sample application. Once the build has and deployment have completed, you can browse to the application using the url you find in project overview.

dotnet-example

The dotnet-example template can be used to create a new .NET Core service in OpenShift. It provides parameters for all the environment variables of the s2i-dotnetcore builder. It also includes a liveness and a readiness probe.

dotnet-runtime-example

The dotnet-runtime-example template can be used to create a new .NET Core service in OpenShift. It is meant to serve as an example of how to create a 'chained build' where one image is used to build an application but the runtime image is used to deploy the application.

For more information on build chaining in OpenShift, please see this doc.

dotnet-pgsql-persistent

The dotnet-pgsql-persistent creates a .NET Core service with a PostgreSQL backend. It provides parameters for all the environment variables of the s2i-dotnetcore builder and variables to setup the database. The database connection information is passed to the .NET application via the ConnectionString environment variable.

community/dotnet-baget.json

Provides templates for deploying a persistent, or ephemeral NuGet Server on OpenShift. These templates use BaGet, an open-source NuGet server implementation. Source code for BaGet can be found at: https://github.com/loic-sharma/BaGet.git.

You can’t perform that action at this time.