SlideShare une entreprise Scribd logo
1  sur  35
Docker &
Asp.Net Core
Fatih Şimşek
Software Architect
Agenda
• Docker
• Docker Demo
• Asp.Net Core
• Break
• Asp.Net Core Demo
• Asp.Net Core & Docker Demo
• Questions
Docker
• Created in Golang
• Open Source
• Lightweight
• Stand-alone
• Platform-independent
• Ship Software Faster
• Environment Consistency
Docker
Docker
• Community & Enterprise Edition
• Build Once, Run Anywhere
Docker Install
• Windows 7/8
Install Docker Toolbox
• Windows 10+ Pro
Install Docker CE
• Docker for Windows Installer
• docker version
Key Concepts
• Image
• Container
• Dockerfile
• Docker Compose
Docker Architecture
Docker Architecture
Docker vs VM
Docker Commands
• docker pull [image name]
• docker images
• docker rmi [image ID]
• docker run [image name]
• docker ps –a
• docker rm [container ID]
• docker build [image name]
• docker stop
• docker kill
• docker logs
Docker Commands
• docker inspect [container ID]
• docker exec -it [container ID] cmd
• docker volume
• docker network
Demo
Docker File
• Text file used to build Docker images
• Contains build instructions
• Instructions create intermediate image that can be cached to speed
up future builds
FROM ENTRYPOINT ENV
RUN WORKDIR VOLUME
COPY EXPOSE CMD
Container Network
• Networking with containers is a very important feature
• Allows users to define their own networks and connect containers to
them
• Create a network on a single host or a network that spans across
multiple hosts
docker network create [OPTIONS] my-network
docker run –d --net=my-network --name my-container mongo
docker network ls
docker network inspect my-network
Docker Compose
• Manage the whole application lifecycle
• Build service configuration file (docker-compose.yml)
Docker Swarm
• Container orchestration platform
• Developed by Docker
• Open-source
• 3500+ commits, 150+ contributors
• Tightly integrated into the Docker ecosystem
• Use Docker API and networking
• Zero single-point-of-failure architecture
• Simple installation
• Easier learning curve
Kubernete
• Container orchestration platform
• Built by Google
• Open-source
• 65000+ commits, 1500+ contributors
• More mature
• Largest market share
• More extensive and customizable
• Manual installation
• Serious planning to make up and down
• Steep learning curve
Asp.Net Core
• Open Source
• Improved Performance
• Host on IIS, Nginx, Apache or self-host
• Ability to build and run on Windows, macOS, and Linux
• Built-in dependency injection
• Light-weight and modular HTTP request pipeline
• Environment-based configuration
• Simplified csproj file
• Ships entirely as NuGet packages
• View Component, Tag Helpers
Asp.net Core
Asp.Net Core
• .Net Framework 4.6.1
• .Net Core 2.0
• Mono 5.4
• Xamarin.iOS 10.14
• Xamarin.Mac 3.8
• Xamarin.Android 7.5
• Upcoming version of
UWP
Asp.Net Core
Startup of the App
Main method in Program.cs
Middleware
• Asp.net Core Apps are built on the middleware pipeline
• Opposed to HttpHandlers and HttpModules, middleware is created
and used programmatically without a config file
• Add and Remove easily in the Configure method of the Startup
Middleware
Some of the built-in middlewares :
• Authentication
• CORS
• Response caching
• Response compression
• Routing
• Session
• Static files
• URL rewriting
Demo
Razor Pages
• @page
• MVVM Framework
• Two-way Data Binding
• Razor support
• Tag Helpers
• HTML Helpers
• Handlers (OnGet, OnGetAsync, OnPostAsync etc..)
View Component
• Create more Reusable Components than Partial Views
• More Powerful
• Have parameters and business logic
• Loaded from External Assemblies
• Used whenever need templates for views, for rendering a group of
elements, and associating server code with it
Tag Helpers
• Allow server-side code to be used when creating and rendering HTML
elements
• ASP.NET Core 2.0 already provides many built-in Tag Helpers
• Used whenever append behavior to a single HTML element
Dependecy Injection
ConfigureServices Method in Startup.cs
Security
• ASP.NET Core Identity
• Cookie-based Authentication
• Token-based Authentication
• Windows Authentication
• OpenId Connect
• Authorization
Hosting
• Kestrel
• IIS
• Nginx
• Apache Server
• Windows Service
Demo
Q & A

Contenu connexe

Tendances

DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
Docker, Inc.
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 

Tendances (20)

Azure Container Services
Azure Container Services Azure Container Services
Azure Container Services
 
Let's serve your data
Let's serve your dataLet's serve your data
Let's serve your data
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as Code
 
Docker presentation for sharing
Docker presentation   for sharingDocker presentation   for sharing
Docker presentation for sharing
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
 
Docker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy MicroservicesDocker Meetup Rosenheim: Package & deploy Microservices
Docker Meetup Rosenheim: Package & deploy Microservices
 
CloudFoundry@home
CloudFoundry@homeCloudFoundry@home
CloudFoundry@home
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Mini-Training: Redis
Mini-Training: RedisMini-Training: Redis
Mini-Training: Redis
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Production Ready Containers from IBM and Docker
Production Ready Containers from IBM and DockerProduction Ready Containers from IBM and Docker
Production Ready Containers from IBM and Docker
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Introduction to containers a practical session using core os and docker
Introduction to containers  a practical session using core os and dockerIntroduction to containers  a practical session using core os and docker
Introduction to containers a practical session using core os and docker
 
Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.Servlets made easy. 
Write once and run everywhere.
Servlets made easy. 
Write once and run everywhere.
 
Introduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes TrainingIntroduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes Training
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
 
Find your data - use GraphDB capabilities in XPages applications - and beyond
Find your data - use GraphDB capabilities in XPages applications - and beyond	Find your data - use GraphDB capabilities in XPages applications - and beyond
Find your data - use GraphDB capabilities in XPages applications - and beyond
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 

Similaire à Docker With Asp.net Core

IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
IBM France Lab
 

Similaire à Docker With Asp.net Core (20)

Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWSCloudsolutionday 2016: DevOps workflow with Docker on AWS
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Node and Azure
Node and AzureNode and Azure
Node and Azure
 
Docker - Hack Salem! - November 2014
Docker - Hack Salem! - November 2014Docker - Hack Salem! - November 2014
Docker - Hack Salem! - November 2014
 
Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET Developers
 
Docker Workshop
Docker WorkshopDocker Workshop
Docker Workshop
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Informix on Docker Hub
Informix on Docker HubInformix on Docker Hub
Informix on Docker Hub
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
IBM Bluemix Paris Meetup #14 - Le Village by CA - 20160413 - Introduction à D...
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
 
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep DiveDocker and Microsoft - Windows Server 2016 Technical Deep Dive
Docker and Microsoft - Windows Server 2016 Technical Deep Dive
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 

Dernier

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 

Docker With Asp.net Core

  • 1. Docker & Asp.Net Core Fatih Şimşek Software Architect
  • 2. Agenda • Docker • Docker Demo • Asp.Net Core • Break • Asp.Net Core Demo • Asp.Net Core & Docker Demo • Questions
  • 3. Docker • Created in Golang • Open Source • Lightweight • Stand-alone • Platform-independent • Ship Software Faster • Environment Consistency
  • 5. Docker • Community & Enterprise Edition • Build Once, Run Anywhere
  • 6. Docker Install • Windows 7/8 Install Docker Toolbox • Windows 10+ Pro Install Docker CE • Docker for Windows Installer • docker version
  • 7. Key Concepts • Image • Container • Dockerfile • Docker Compose
  • 11. Docker Commands • docker pull [image name] • docker images • docker rmi [image ID] • docker run [image name] • docker ps –a • docker rm [container ID] • docker build [image name] • docker stop • docker kill • docker logs
  • 12. Docker Commands • docker inspect [container ID] • docker exec -it [container ID] cmd • docker volume • docker network
  • 13. Demo
  • 14. Docker File • Text file used to build Docker images • Contains build instructions • Instructions create intermediate image that can be cached to speed up future builds FROM ENTRYPOINT ENV RUN WORKDIR VOLUME COPY EXPOSE CMD
  • 15. Container Network • Networking with containers is a very important feature • Allows users to define their own networks and connect containers to them • Create a network on a single host or a network that spans across multiple hosts docker network create [OPTIONS] my-network docker run –d --net=my-network --name my-container mongo docker network ls docker network inspect my-network
  • 16. Docker Compose • Manage the whole application lifecycle • Build service configuration file (docker-compose.yml)
  • 17. Docker Swarm • Container orchestration platform • Developed by Docker • Open-source • 3500+ commits, 150+ contributors • Tightly integrated into the Docker ecosystem • Use Docker API and networking • Zero single-point-of-failure architecture • Simple installation • Easier learning curve
  • 18. Kubernete • Container orchestration platform • Built by Google • Open-source • 65000+ commits, 1500+ contributors • More mature • Largest market share • More extensive and customizable • Manual installation • Serious planning to make up and down • Steep learning curve
  • 19. Asp.Net Core • Open Source • Improved Performance • Host on IIS, Nginx, Apache or self-host • Ability to build and run on Windows, macOS, and Linux • Built-in dependency injection • Light-weight and modular HTTP request pipeline • Environment-based configuration • Simplified csproj file • Ships entirely as NuGet packages • View Component, Tag Helpers
  • 21. Asp.Net Core • .Net Framework 4.6.1 • .Net Core 2.0 • Mono 5.4 • Xamarin.iOS 10.14 • Xamarin.Mac 3.8 • Xamarin.Android 7.5 • Upcoming version of UWP
  • 23.
  • 24. Startup of the App Main method in Program.cs
  • 25. Middleware • Asp.net Core Apps are built on the middleware pipeline • Opposed to HttpHandlers and HttpModules, middleware is created and used programmatically without a config file • Add and Remove easily in the Configure method of the Startup
  • 26. Middleware Some of the built-in middlewares : • Authentication • CORS • Response caching • Response compression • Routing • Session • Static files • URL rewriting
  • 27. Demo
  • 28. Razor Pages • @page • MVVM Framework • Two-way Data Binding • Razor support • Tag Helpers • HTML Helpers • Handlers (OnGet, OnGetAsync, OnPostAsync etc..)
  • 29. View Component • Create more Reusable Components than Partial Views • More Powerful • Have parameters and business logic • Loaded from External Assemblies • Used whenever need templates for views, for rendering a group of elements, and associating server code with it
  • 30. Tag Helpers • Allow server-side code to be used when creating and rendering HTML elements • ASP.NET Core 2.0 already provides many built-in Tag Helpers • Used whenever append behavior to a single HTML element
  • 32. Security • ASP.NET Core Identity • Cookie-based Authentication • Token-based Authentication • Windows Authentication • OpenId Connect • Authorization
  • 33. Hosting • Kestrel • IIS • Nginx • Apache Server • Windows Service
  • 34. Demo
  • 35. Q & A

Notes de l'éditeur

  1. Docker is available for implementation across a wide range of platforms: Desktop: Mac OS, Windows 10. Server: Various Linux distributions and Windows Server 2016. Cloud: Amazon Web Services, Google Compute Platform, Microsoft Azure, IBM Cloud, and more.
  2. Docker Daemon: A persistent background process that manages Docker images, containers, networks, and storage volumes. The Docker daemon constantly listens for Docker API requests and processes them. Docker Engine REST API: An API used by applications to interact with the Docker daemon; it can be accessed by an HTTP client. Docker CLI: A command line interface client for interacting with the Docker daemon. It greatly simplifies how you manage container instances and is one of the key reasons why developers love using Docker.
  3. docker run -ti busybox (interactive) kill all running containers with docker kill $(docker ps -q) delete all stopped containers with docker rm $(docker ps -a -q) delete all images with docker rmi $(docker images -q)
  4. Running Container & Inspect
  5. Volume: Special type of directory in a container typically referred to as a “data volume” Can be shared and reused among containers Updates to an image won’t affect a data volume docker run –p 8080:3000 –v $(pwd):/app microsoft/aspnetcore-build docker inspect containerId FROM creates a layer from the ubuntu:15.04 Docker image. COPY adds files from your Docker client’s current directory. RUN builds your application with make. CMD specifies what command to run within the container. CMD [“/bin/bash”, “-c”, “dotnet restore && dotnet run”] EXPOSE DockerHostPort ENTRYPOINT dotnet myapp.dll
  6. All Docker installations represent the docker0 network with bridge; Docker connects to bridge by default. Run ifconfig on the Linux host to view the bridge network
  7. Docker-compose.yml: Build, environment, image, networks, volumes, ports docker-compose build docker-compose up (create and start containers) docker-compose down (stop and remove containers) docker-compose logs docker-compose ps docker-compose start docker-compose stop docker-compose rm
  8. using an internal cluster management system called Borg (sometimes referred to as Omega) due to being out longer (v1.0 came out in July 2015)
  9. The Program class is the main entry point for ASP.NET Core 2.0 applications. In fact, ASP.NET Core 2.0 applications are very similar to standard .NET Framework console applications in this regard The new Microsoft.AspNet.Core.All package contains all ASP.NET Core 2.0 features in a single library.(you can still reference them manually instead of using the single packages) The runtime store is an important new component shipped with ASP.NET Core 2.0. It contains compiled packages, which were compiled using the native machine language and it is key for improved performance. All applications using the Microsoft.AspNet.Core.All package benefit from it Docker container images including ASP.NET Core 2.0 applications are much smaller than images with classic ASP.NET applications, meaning that they are faster to deploy and to start-up.
  10. Previous versions of ASP.NET had a very close relation with Internet Information Services (IIS), Wanting to change this, Microsoft defined the Open Web Interface for .NET (OWIN) specification .NET Core borrowed heavily from the OWIN specification. There are no more Global.asax, web.config, or machine.config configuration files, modules or handlers Some bootstrap code declares a class that contains a convention-defined method (Startup will be used, if no class is declared) This conventional method, which should be called Configure, receives as its sole parameter a pointer to an IApplicationBuilder instance You then start adding middleware to the IApplicationBuilder; this middleware is what will handle your web requests
  11. Microsoft estimates that about 70% of the libraries on NuGet should just work with .NET Core now WCF, WPF API
  12. Additional Topics
  13. HostingEnvironment => launchSettings.json, Command-line arguments, encrypted user store, custom provider ASPNETCORE_ENVIRONMENT => Development, Staging, Production
  14. An HttpModule runs for each request before arriving at the handler that generates the response, and/or after it generates the response A Handler handles the request and generates the response for a given file extension
  15. _ViewImports.cshtml  @using AspNetCoreDemo @addTagHelper*, Microsoft.AspNetCore.Mvc.TagHelpers _ViewStart.cshtml  @{ Layout = "~/Views/Shared/_Layout.cshtml"; } Access to these files is not available by default  app.UseStaticFiles(); Note that by default all static files served by this middleware are public and anyone can access them. If you need to protect some of your files, you need to either store them outside the wwwroot folder or you need to use the FileResult controller action, which supports the authorization middleware. Activate Session: app.UseSession();
  16. Instance: The instance is given all the time. We are responsible for its creation. Transient: The instance is created each time we use the object. Scoped: The instance is created once by the HTTP request. Singleton: The instance is created once by the application instance.
  17. UserManager<IdentityUser> SignInManager<IdentityUser>
  18. Kestrel is the default, multi-platform, web server. It offers acceptable performance, but lacks lots of features that are expected in real-life: No buffering No support for Windows authentication (as time passes, this is less of a problem) No WebSockets No HTTP/2 No direct file transmission No strong security protection
  19. Deploying Asp.net Core Application To Docker
  20. Additional Topics