Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Using OpenShift to deploy .NET Core applications

July 5, 2018
Tom Deseyn
Related topics:
.NETDeveloper ToolsKubernetes
Related products:
Red Hat OpenShift Container PlatformRed Hat Enterprise Linux

Share:

    Containers are the new way of deploying applications. They provide an efficient mechanism to deploy self-contained applications in a portable way across clouds and OS distributions. In this blog post we'll look at what OpenShift brings for .NET Core specifically.

    Kubernetes and OpenShift

    Kubernetes is the de facto orchestrator for managing containerized applications. Google open-sourced Kubernetes in 2014 and Red Hat was one of the first companies to work with Google on Kubernetes. Red Hat is the 2nd leading contributor to the Kubernetes upstream project.

    OpenShift is an open-source DevOps platform that is built on top of Kubernetes. It integrates directly with your application’s source code. This enables continuous integration/continuous deployment (CI/CD) workflows. Tools are available to scale and monitor your applications. The OpenShift Catalog makes it easy to setup middleware and databases. OpenShift comes with comprehensive documentation to install and manage your installation. It can run on-prem and on public clouds such as AWS, GCP and Azure.

    .NET Core on OpenShift

    .NET Core is an open-source, cross-platform .NET implementation. It was open-sourced in 2015 by Microsoft. Like with Kubernetes and OpenShift, this permits anyone to build, maintain and support .NET Core. Red Hat is doing this since the 1.0 release and, in tandem with Microsoft, Red Hat provides services releases and new .NET Core releases for Red Hat Enterprise Linux (RHEL) and OpenShift. Recently, Red Hat announced availability of .Net Core 2.1.

    For RHEL, this means the .NET Core SDK and runtime are available for building and running applications. For OpenShift, it means there is a source-to-image (s2i) builder for .NET Core which makes OpenShift understand how to build .NET Core applications.

    The s2i-builder can be tuned with variables and it supports many typical workflows. If more control is required, a custom script (.s2i/bin/assemble) can be versioned with the source code that directly controls the build. Even more advanced scenarios are possible using Jenkins on OpenShift, which also supports .NET Core.

    Getting Started

    You can run OpenShift on your development machine using minishift. minishift comes as part of the Red Hat Container Development Kit (CDK). The CDK documentation describes how to install and start minishift. CDK is available as part of the no-cost development subscription. It runs on Windows and macOS too!

    For a production installation, you need to follow the OpenShift and cloud-vendor specific documentation. If you want to try OpenShift on the public cloud without installing it yourself, you can create a free account at OpenShift Online.

    Once you have your OpenShift instance running, deploying an application can be done via the OpenShift web UI (called 'Console') or the OpenShift cli (oc). The cli comes as part of the CDK installation, you can also download it from the openshift/origin GitHub project. To deploy the application we use the oc new-app command:

    $ oc new-app --name=exampleapp dotnet:2.1~https://github.com/redhat-developer/s2i-dotnetcore-ex#dotnetcore-2.1 --build-env DOTNET_STARTUP_PROJECT=app

    This tells OpenShift to deploy a .NET Core application and name it exampleapp. dotnet:2.1 is the name of the s2i-builder for .NET Core 2.1. https://github.com/redhat-developer/s2i-dotnetcore-ex and dotnetcore-2.1 are the git repo and branch respectively. We set DOTNET_STARTUP_PROJECT to tell the s2i-builder our application is in the app directory.

    The Console shows the status of the build and deployment:

    Note that we didn't have to write a Dockerfile and use it to build an image locally. OpenShift fetched our sources from git and built them in a contained, controlled environment!

    When new service releases of .NET Core become available, the application will automatically be rebuilt and redeployed to use the latest patch version. To enable a CI/CD workflow, OpenShift can be configured to rebuild and redeploy on source branch changes as well.

    Conclusion

    In this blog post, we've looked at the differences between Kubernetes and OpenShift. We've also looked at how OpenShift supports .NET Core.  The .NET Core Getting Started Guide has more info about running .NET Core on RHEL and OpenShift.

    To get started with development, download Red Hat Container Development Kit. You'll get an OpenShift (and Kubernetes) development environment in a VM that you can run on your Windows, Mac, or Linux laptop.

    OpenShift documentation is available at https://docs.openshift.com/.  You can also download the free ebook, Deploying to OpenShift.

    Last updated: November 2, 2023

    Recent Posts

    • Why some agentic AI developers are moving code from Python to Rust

    • Confidential VMs: The core of confidential containers

    • Benchmarking with GuideLLM in air-gapped OpenShift clusters

    • Run Qwen3-Next on vLLM with Red Hat AI: A step-by-step guide

    • How to implement observability with Python and Llama Stack

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2025 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue