Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

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

    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

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    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
    © 2026 Red Hat

    Red Hat legal and privacy links

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

    Chat Support

    Please log in with your Red Hat account to access chat support.