getting started guide - red hat · pdf filechapter ocker 3.1. linux containers ... chapter m...

21
Red Hat Customer Content Services .NET Core 1.1 Getting Started Guide Installing .NET Core on Red Hat Enterprise Linux

Upload: dinhdiep

Post on 20-Mar-2018

220 views

Category:

Documents


2 download

TRANSCRIPT

  • Red Hat Customer ContentServices

    .NET Core 1.1Getting Started Guide

    Installing .NET Core on Red Hat Enterprise Linux

  • .NET Core 1.1 Getting Started Guide

    Installing .NET Core on Red Hat Enterprise Linux

  • Legal NoticeCopyright 2017 Red Hat, Inc.

    The text of and illustrations in this document are licensed by Red Hat under a CreativeCommons AttributionShare Alike 3.0 Unported license ("CC-BY-SA"). An explanation ofCC-BY-SA is available athttp://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it,you must provide the URL for the original version.

    Red Hat, as the licensor of this document, waives the right to enforce, and agrees not toassert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.

    Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, OpenShift, Fedora, theInfinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United Statesand other countries.

    Linux is the registered trademark of Linus Torvalds in the United States and othercountries.

    Java is a registered trademark of Oracle and/or its affiliates.

    XFS is a trademark of Silicon Graphics International Corp. or its subsidiaries in theUnited States and/or other countries.

    MySQL is a registered trademark of MySQL AB in the United States, the EuropeanUnion and other countries.

    Node.js is an official trademark of Joyent. Red Hat Software Collections is not formallyrelated to or endorsed by the official Joyent Node.js open source or commercial project.

    The OpenStack Word Mark and OpenStack logo are either registeredtrademarks/service marks or trademarks/service marks of the OpenStack Foundation, inthe United States and other countries and are used with the OpenStack Foundation'spermission. We are not affiliated with, endorsed or sponsored by the OpenStackFoundation, or the OpenStack community.

    All other trademarks are the property of their respective owners.

    AbstractThe .NET Core platform is a general purpose development platform featuring automaticmemory management and modern programming languages. It allows users to buildhigh-quality applications efficiently. The .NET Core platform is available in Red HatEnterprise Linux (RHEL 7) and OpenShift Container Platform via certified containers.The .NET Core platform offers: the ability to follow a microservices-based approach,where some components are built with .NET and others with Java, but all can run on acommon, supported platform in Red Hat Enterprise Linux and OpenShift ContainerPlatform. the capacity to more easily develop new .NET Core workloads on MicrosoftWindows. Customers can deploy and run on either Red Hat Enterprise Linux or WindowsServer. a heterogeneous datacenter, where the underlying infrastructure is capable ofrunning .NET applications without having to rely solely on Windows Server. access tomany of the popular development frameworks, such as .NET, Java, Ruby, and Pythonfrom within OpenShift Container Platform. .NET Core 1.1 is supported on Red HatEnterprise Linux 7 and OpenShift Container Platform versions 3.3 and later.

  • . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    Table of ContentsCHAPTER 1. INSTALL .NET CORE 1.1 ON RED HAT ENTERPRISE LINUX

    1.1. INSTALL .NET CORE 1.11.2. CREATE A .NET CORE 1.1 PROJECT

    CHAPTER 2. .NET CORE 1.1 ON RED HAT OPENSHIFT CONTAINER PLATFORM2.1. IMAGES2.2. CONFIGURATION2.3. QUICKLY DEPLOY APPLICATIONS FROM .NET CORE SOURCE

    CHAPTER 3. DOCKER3.1. LINUX CONTAINERS3.2. GET DOCKER IN RED HAT ENTERPRISE LINUX 73.3. GET DOCKER IN RED HAT ENTERPRISE LINUX 7 ATOMIC HOST3.4. WORKING WITH DOCKER-FORMATTED CONTAINERS3.5. USE .NET CORE CONTAINER IMAGES

    CHAPTER 4. .NET CORE TEMPLATES AND SAMPLE APPS4.1. .NET CORE TEMPLATES4.2. .NET CORE SAMPLE APPS

    CHAPTER 5. REFERENCE MATERIAL

    APPENDIX A. REVISION HISTORY

    334

    5558

    99

    10101011

    141414

    15

    16

    Table of Contents

    1

  • .NET Core 1.1 Getting Started Guide

    2

  • CHAPTER 1. INSTALL .NET CORE 1.1 ON RED HATENTERPRISE LINUXThis Getting Started Guide describes how to install .NET Core 1.1 on Red Hat EnterpriseLinux (RHEL).

    1. Install RHEL 7 using one of the following images:

    Red Hat Enterprise Linux 7 Server

    Red Hat Enterprise Linux 7 Workstation

    Red Hat Enterprise Linux for Scientific Computing

    2. Register the system by following the appropriate steps in Registering,Unregistering, and Reregistering a System in the Red Hat SubscriptionManagement document. You can also use the following command to register thesystem.

    # subscription-manager register

    3. Display a list of all subscriptions that are available for your system and identifythe pool ID for the subscription.

    # subscription-manager list --available

    This command displays its name, unique identifier, expiration date, and otherdetails related to it. The pool ID is listed on a line beginning with Pool ID.

    4. Attach the subscription that provides access to the dotNET on RHEL repository.Replace pool_id with the pool ID you identified in the previous step.

    # subscription-manager attach --pool=

    5. Verify the list of subscriptions attached to your system.

    # subscription-manager list --consumed

    6. Enable the .NET Core channel for Red Hat Enterprise 7 Server, Red HatEnterprise 7 Workstation, or HPC Compute Node with one of the followingcommands, respectively.

    # subscription-manager repos --enable=rhel-7-server-dotnet-rpms# subscription-manager repos --enable=rhel-7-workstation-dotnet-rpms# subscription-manager repos --enable=rhel-7-hpc-node-dotnet-rpms

    7. Install the scl tool.

    # yum install scl-utils

    1.1. INSTALL .NET CORE 1.1

    CHAPTER 1. INSTALL .NET CORE 1.1 ON RED HAT ENTERPRISE LINUX

    3

    https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.3/x86_64/product-softwarehttps://access.redhat.com/downloads/content/71/ver=/rhel---7/7.3/x86_64/product-softwarehttps://access.redhat.com/downloads/content/76/ver=/rhel---7/7.3/x86_64/product-softwarehttps://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/registering-machine-ui.html

  • 1. Install .NET Core 1.1 and all of its dependencies.

    # yum install rh-dotnetcore11

    2. Enable the rh-dotnetcore11 collection environment.

    $ scl enable rh-dotnetcore11 bash

    This command does not persist; it creates