Skip to content

Commit

Permalink
Make some changes as we change our default branch from 'master' to 'm…
Browse files Browse the repository at this point in the history
…ain'. (#454)

- Updates urls from 'master' to 'main'.
- Remove old templates, image streams and install scripts.
- Clean-up the README.
  • Loading branch information
tmds authored Apr 25, 2023
1 parent d67c248 commit 63eaceb
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 2,704 deletions.
187 changes: 31 additions & 156 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
.NET Core Docker Image
======================
# .NET S2I Container Images

This repository contains the source for building .NET Core apps as reproducible
Docker images using
[source-to-image](https://github.com/openshift/source-to-image). The resulting
image can be run using [Docker](http://docker.io).
This repository contains the sources for building .NET SDK and runtime container images.

Versions
----------------
The images support OpenShift [source-to-image](https://github.com/openshift/source-to-image).

## Supported Versions

.NET Core versions currently provided are:
| Version | OS | Documentation
|--|--|--|
| 6.0 | UBI 8, Fedora | [SDK image](6.0/build/README.md) <br/> [Runtime image](6.0/runtime/README.md)
| 7.0 | UBI 8, Fedora | [SDK image](7.0/build/README.md) <br/> [Runtime image](7.0/runtime/README.md)

* 6.0 (RHEL 8, Fedora)
* 7.0 (RHEL 8, Fedora)
* [RETIRED] 1.0 (RHEL 7, CentOS 7)
* [RETIRED] 1.1 (RHEL 7)
* [RETIRED] 2.0 (RHEL 7, CentOS 7)
* [RETIRED] 2.1 (RHEL 7, RHEL 8, CentOS 7)
* [RETIRED] 2.2 (RHEL 7, CentOS 7)
* [RETIRED] 3.0 (RHEL 7, RHEL 8)
* [RETIRED] 3.1 (RHEL 7, RHEL 8, CentOS 7, Fedora)
* [RETIRED] 5.0 (RHEL 8, CentOS 7, Fedora)
## EOL Versions

| Version | OS | Documentation
|--|--|--|
| 1.0 | RHEL 7, CentOS 7 | [SDK image](1.0/build/README.md) <br/> [Runtime image](1.0/runtime/README.md)
| 1.1 | RHEL 7 | [SDK image](1.1/build/README.md) <br/> [Runtime image](1.1/runtime/README.md)
| 2.0 | RHEL 7, CentOS 7 | [SDK image](2.0/build/README.md) <br/> [Runtime image](2.0/runtime/README.md)
| 2.1 | RHEL 7, UBI 8, <br/> CentOS 7 | [SDK image](2.1/build/README.md) <br/> [Runtime image](2.1/runtime/README.md)
| 2.2 | RHEL 7, CentOS 7 | [SDK image](2.2/build/README.md) <br/> [Runtime image](2.2/runtime/README.md)
| 3.0 | RHEL 7, UBI 8 | [SDK image](3.0/build/README.md) <br/> [Runtime image](3.0/runtime/README.md)
| 3.1 | RHEL 7, UBI 8, <br/> CentOS 7, Fedora | [SDK image](3.1/build/README.md) <br/> [Runtime image](3.1/runtime/README.md)
| 5.0 | UBI 8, CentOS 7, <br/> Fedora | [SDK image](5.0/build/README.md) <br/> [Runtime image](5.0/runtime/README.md)

Building
----------------
Expand All @@ -30,149 +32,22 @@ $ git clone https://github.com/redhat-developer/s2i-dotnetcore.git
$ sudo VERSIONS=7.0 ./build.sh
```

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

Installing
----------------

The image streams can be installed using the `dotnet_imagestreams_*.json` files with the OpenShift client `oc`.

This repo contains a script that helps install/upgrade/remove the imagestreams.

### Linux/macOS

script: https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/install-imagestreams.sh

For example, to install the `rhel` based images and add a secret for authenticating against the `registry.redhat.io` registry:
The image streams can be added to OpenShift by importing an `dotnet_imagestreams_*.json` file with the OpenShift client `oc`.

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

You can run `./install-imagestreams.sh --help` for more information.

### Windows

script: https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/install-imagestreams.ps1

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

```sh
PS > Invoke-WebRequest https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/install-imagestreams.ps1 -UseBasicParsing -OutFile install-imagestreams.ps1
PS > .\install-imagestreams.ps1 -OS rhel -User <subscription_username> -Password <subscription_password>
oc apply -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/main/dotnet_imagestreams.json
```

Running scripts may be prohibited by the `ExecutionPolicy`, you can relax the policy by running: `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force`

You can run `Get-Help .\install-imagestreams.ps1` for more information.

Usage
---------------------------------

For information about usage of Docker image for .NET Core 7.0,
see [7.0 builder usage documentation](7.0/build/README.md) and
[7.0 runtime usage documentation](7.0/runtime/README.md).

For information about usage of Docker image for .NET Core 6.0,
see [6.0 builder usage documentation](6.0/build/README.md) and
[6.0 runtime usage documentation](6.0/runtime/README.md).

For information about usage of Docker image for .NET Core 3.1,
see [3.1 builder usage documentation](3.1/build/README.md) and
[3.1 runtime usage documentation](3.1/runtime/README.md).

For information about usage of Docker image for .NET Core 5.0,
see [5.0 builder usage documentation](5.0/build/README.md) and
[5.0 runtime usage documentation](5.0/runtime/README.md).

For information about usage of Docker image for .NET Core 3.0,
see [3.0 builder usage documentation](3.0/build/README.md) and
[3.0 runtime usage documentation](3.0/runtime/README.md).

For information about usage of Docker image for .NET Core 2.2,
see [2.2 builder usage documentation](2.2/build/README.md) and
[2.2 runtime usage documentation](2.2/runtime/README.md).

For information about usage of Docker image for .NET Core 2.1,
see [2.1 builder usage documentation](2.1/build/README.md) and
[2.1 runtime usage documentation](2.1/runtime/README.md).

For information about usage of Docker image for .NET Core 2.0,
see [2.0 builder usage documentation](2.0/build/README.md) and
[2.0 runtime usage documentation](2.0/runtime/README.md).

For information about usage of Docker image for .NET Core 1.1,
see [1.1 usage documentation](1.1/README.md).

For information about usage of Docker image for .NET Core 1.0,
see [1.0 usage documentation](1.0/README.md).

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](https://docs.okd.io/latest/cicd/builds/advanced-build-operations.html#builds-chaining-builds_advanced-build-operations).

**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.

**aspnet-2.x.json**

Provides `aspnet:2.1` image streams that are built on top of `dotnet:2.1` using a `Docker` strategy and include
ASP.NET Core NuGet packages. Using these streams results in improved build speed, because the NuGet packages no longer need to be downloaded.

You can add these imagestreams by running:
```
oc create -f https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/master/templates/aspnet-2.x.json
```

After the file is imported in OpenShift, OpenShift will build the `aspnet:2.1` images. This will take a few minutes. Once that is
complete, they can be used as replacements for the `dotnet:2.1` image streams. For example:

```
oc new-app --name=myapp aspnet:2.1~https://github.com/redhat-developer/s2i-dotnetcore-ex#dotnetcore-2.1 --build-env DOTNET_STARTUP_PROJECT=app
```

**note**: `dotnet:3.0`+ image streams include ASP.NET Core build dependencies by default.

**community/dotnet-baget.json**
The `dotnet_imagestreams_*.json` files define the supported .NET versions for a specific architecture:

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.
| Architecture | File |
|--|--|
| x64 | https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/main/dotnet_imagestreams.json |
| arm64 | https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/main/dotnet_imagestreams_aarch64.json |
| ppc64le | https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/main/dotnet_imagestreams_ppc64le.json |
| s390x | https://raw.githubusercontent.com/redhat-developer/s2i-dotnetcore/main/dotnet_imagestreams_s390x.json |
20 changes: 10 additions & 10 deletions dotnet_imagestreams.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"name": "latest",
"annotations": {
"openshift.io/display-name": ".NET (Latest)",
"description": "Build and run .NET applications. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/build/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of .NET available on OpenShift, including major versions updates.",
"description": "Build and run .NET applications. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/build/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of .NET available on OpenShift, including major versions updates.",
"iconClass": "icon-dotnet",
"tags": "builder,.net,dotnet,dotnetcore,hidden",
"supports": "dotnet",
Expand All @@ -45,7 +45,7 @@
"name": "7.0-ubi8",
"annotations": {
"openshift.io/display-name": ".NET 7 (UBI 8)",
"description": "Build and run .NET 7 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/build/README.md.",
"description": "Build and run .NET 7 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/build/README.md.",
"iconClass": "icon-dotnet",
"tags": "builder,.net,dotnet,dotnetcore,dotnet70",
"supports": "dotnet:7.0,dotnet",
Expand All @@ -66,7 +66,7 @@
"name": "7.0",
"annotations": {
"openshift.io/display-name": ".NET 7 (UBI 8)",
"description": "Build and run .NET 7 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/build/README.md.",
"description": "Build and run .NET 7 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/build/README.md.",
"iconClass": "icon-dotnet",
"tags": "builder,.net,dotnet,dotnetcore,dotnet70,hidden",
"supports": "dotnet:7.0,dotnet",
Expand All @@ -87,7 +87,7 @@
"name": "6.0-ubi8",
"annotations": {
"openshift.io/display-name": ".NET 6 (UBI 8)",
"description": "Build and run .NET 6 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/6.0/build/README.md.",
"description": "Build and run .NET 6 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/6.0/build/README.md.",
"iconClass": "icon-dotnet",
"tags": "builder,.net,dotnet,dotnetcore,dotnet60",
"supports": "dotnet:6.0,dotnet",
Expand All @@ -108,7 +108,7 @@
"name": "6.0",
"annotations": {
"openshift.io/display-name": ".NET 6 (UBI 8)",
"description": "Build and run .NET 6 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/6.0/build/README.md.",
"description": "Build and run .NET 6 applications on UBI 8. For more information about using this builder image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/6.0/build/README.md.",
"iconClass": "icon-dotnet",
"tags": "builder,.net,dotnet,dotnetcore,dotnet60,hidden",
"supports": "dotnet:6.0,dotnet",
Expand Down Expand Up @@ -144,7 +144,7 @@
"name": "latest",
"annotations": {
"openshift.io/display-name": ".NET Runtime (Latest)",
"description": "Run .NET applications. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/runtime/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of .NET Core Runtime available on OpenShift, including major versions updates.",
"description": "Run .NET applications. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/runtime/README.md.\n\nWARNING: By selecting this tag, your application will automatically update to use the latest version of .NET Core Runtime available on OpenShift, including major versions updates.",
"iconClass": "icon-dotnet",
"tags": "runtime,.net-runtime,dotnet-runtime,dotnetcore-runtime,hidden",
"supports": "dotnet-runtime"
Expand All @@ -161,7 +161,7 @@
"name": "7.0-ubi8",
"annotations": {
"openshift.io/display-name": ".NET 7 Runtime (UBI 8)",
"description": "Run .NET 7 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/runtime/README.md.",
"description": "Run .NET 7 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/runtime/README.md.",
"iconClass": "icon-dotnet",
"tags": "runtime,.net-runtime,dotnet-runtime,dotnetcore-runtime",
"supports": "dotnet-runtime",
Expand All @@ -179,7 +179,7 @@
"name": "7.0",
"annotations": {
"openshift.io/display-name": ".NET 7 Runtime (UBI 8)",
"description": "Run .NET 7 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/7.0/runtime/README.md.",
"description": "Run .NET 7 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/7.0/runtime/README.md.",
"iconClass": "icon-dotnet",
"tags": "runtime,.net-runtime,dotnet-runtime,dotnetcore-runtime,hidden",
"supports": "dotnet-runtime",
Expand All @@ -197,7 +197,7 @@
"name": "6.0-ubi8",
"annotations": {
"openshift.io/display-name": ".NET 6 Runtime (UBI 8)",
"description": "Run .NET 6 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/6.0/runtime/README.md.",
"description": "Run .NET 6 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/6.0/runtime/README.md.",
"iconClass": "icon-dotnet",
"tags": "runtime,.net-runtime,dotnet-runtime,dotnetcore-runtime",
"supports": "dotnet-runtime",
Expand All @@ -215,7 +215,7 @@
"name": "6.0",
"annotations": {
"openshift.io/display-name": ".NET 6 Runtime (UBI 8)",
"description": "Run .NET 6 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/master/6.0/runtime/README.md.",
"description": "Run .NET 6 applications on UBI 8. For more information about using this image, including OpenShift considerations, see https://github.com/redhat-developer/s2i-dotnetcore/tree/main/6.0/runtime/README.md.",
"iconClass": "icon-dotnet",
"tags": "runtime,.net-runtime,dotnet-runtime,dotnetcore-runtime,hidden",
"supports": "dotnet-runtime",
Expand Down
Loading

0 comments on commit 63eaceb

Please sign in to comment.