SlideShare a Scribd company logo
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
@svswaminathan
http://wannabeegeek.com
Shipping Manifest
The Big Picture for working with Containers
Container Vocabulary
Container Architecture
Micro Services and Containerization
.NET Core
Visual Studio
Visual Studio TeamServices
Azure Container Service
Vocabulary
Commands
Container Lingua Franca
Host OS - Hardware
Hyper Visor
Guest OS #2
Start on Earth – Docker Hello-World
• Docker Containers and VMs
Guest OS #1 (Virtual Machine)
Docker Daemon
Server
Host OS
Hypervisor
Server
Host OS
Docker Engine
Guest
OS
Guest
OS
Guest
OS
Bins/Libs Bins/Libs Bins/Libs
App A App A’ App B
Bins/Libs Bins/Libs
AppA
AppA’
AppB
AppB’
AppB
AppB’
AppB
AppB’
Containers are isolated,
but share OS and, where
appropriate,
bins/libraries
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
PS docker search microsoft
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
microsoft/dotnet Preview images for the .NET Core command l... 107 [OK]
microsoft/azure-cli Docker image for Microsoft Azure Command L... 52 [OK]
microsoft/iis Internet Information Services (IIS) instal... 11
microsoft/oms Monitor your containers using the Operatio... 3 [OK]
microsoft/applicationinsights Application Insights for Docker helps you ... 3 [OK]
microsoft/sample-dotnet .NET Core running in a Nano Server container 1
microsoft/dotnet35 1
PS docker pull microsoft/dotnet
Using default tag: latest
latest: Pulling from microsoft/aspnet
604d05dfd165: Extracting [====================================================> ] 34.78 MB/37.19 MB
a3ed95caeb02: Download complete
af271166b5e5: Download complete
ffff72610562: Pull complete
82633c2ea8fc: Pull complete
1ec63dc1715b: Downloading [=========================> ] 29.72 MB/64.67 MB
9be54d5ae146: Pull complete
c3abf6246d6a: Pull complete
Digest: sha256:cbbc0a7be0926d017ffd952799c4864c2c6cf812cbb70862bf2c8539401aa1e3
Status: Downloaded newer image for microsoft/dotnet:latest
DOCKER_HOST
Images CacheContainers
RegistryClient
Docker pull Docker daemon
Docker run
Docker API
Dot
Net
Dot
Net
Dot
Net
Dot
Net
Vocabulary
Commands
Understanding the Docker Architecture
Building Docker Images
PS dotnet new
PS Code .
# add a docker file
PS dotnet build –c release
PS dotnet publish –c release –o app
PS Docker build –t helloworld .
Sending build context to Docker daemon 667.6 kB
Step 1 : FROM microsoft/dotnet:1.0.0-rc2-core
---> c7a9cf9c81f5
Step 2 : WORKDIR /app
---> Using cache
---> eb9360aaf982
Step 3 : COPY /app /app
---> Using cache
---> 80e66eaa09e0
Step 4 : ENTRYPOINT dotnet DotNetHelloWorld.dll
---> Using cache
---> e559e0c38fbd
Successfully built e559e0c38fbd
PS docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
helloworld latest ae30949a3358 5 seconds ago 242.4 MB
PS docker run helloworld
Hello World!
Registry DOCKER_HOST
ImagesContainers
Docker build
0001Program.cs110
HelloWorld.dll
111010111011011010
Code/Binaries
Client
Docker build
Docker daemon
FROM microsoft/dotnet:latest
WORKDIR /app
COPY /app /app
ENTRYPOINT dotnet HelloWorld.dll
dockerfile
Private Registry
Docker run
Docker push
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Vocabulary
Host A VM running the Docker Daemon to host a collection of Docker Containers
Image An ordered collection of filesystems* to be used when instancing a container
Container A runtime instance of an image
Registry A collection of docker images
Dockerfile Commands to build a Docker image
Tag A version identifier for an image, plus the registry name
docker tag [registrypath]/image:[version]
Commands
Docker search Searches the current registry
Docker pull Pulls a Docker Image to your Docker Host cache
Docker run The process of instancing an Image as a running container
Understanding the Docker Architecture
ImageLayers.io
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
PS docker run -it -v /c/Users/Swami:/wormhole busybox
/ # ls
bin dev etc home proc root sys tmp usr var wormhole
/ # cd wormhole
/wormhole # touch a.txt
/wormhole # touch b.txt
/wormhole # ls
a.txt b.txt
/wormhole # cat a.txt
Hello from the other side of the wormhole
/wormhole #
http://beta.docker.com
Vocabulary
Host A VM running the Docker Daemon to host a collection of Docker Containers
Image An ordered collection of filesystems* to be used when instancing a container
– * see layers, later on
Container A runtime instance of an image
Registry A collection of docker images
Dockerfile Commands to build a Docker image
Tag A version identifier for an image
Volume A means to provide persistent storage from an immutable container
Commands
Docker run The process of instancing an Image as a running container
Docker login Logs into the registry so you can push images
Docker build Creates an image, using a dockerfile as the definition
Docker tag Renames an image: [registryname]/[user]/[imagename]:[tag]
Docker push Pushes an image to a registry
Docker-compose Volumes
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
PS docker-machine ls
NAME ACTIVE DRIVER STATE URL DOCKER
default - virtualbox Running tcp://docker v1/10.1
dockerhost-linux - azure Running tcp://dockerhost-linux.cloudapp.net:2376 v1.10.2
PS docker-machine env dockerhost-linux
$Env:DOCKER_TLS_VERIFY = "1"
$Env:DOCKER_HOST = "tcp://dockerhost-linux.cloudapp.net:2376"
$Env:DOCKER_CERT_PATH = "C:UsersSteveLas.dockermachinemachinesdockerhost-linux"
$Env:DOCKER_MACHINE_NAME = "dockerhost-linux"
# Run this command to configure your shell:
# Docker-machine env dockerhost-linux | Invoke-Expression
PS docker-machine active
dockerhost-linux
PS docker-machine ip dockerhost-linux
dockerhost-linux.cloudapp.net
Note: Docker Machine not required when working with Docker for Windows
PS docker-machine create -d azure --azure-subscription-id "[your azure sub id]"
--azure-open-port 80 mydockerhost
Docker Docs - Docker-machine create -d azure...
Azure Docs - Docker-machine create -d azure ...
Commands
Docker Docs - Docker-machine create -d azure...
Azure Docs - Docker-machine create -d azure ...
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Local Development
Environment
Integration
Registry
Production
Staging
Test
Client
Container Workflow
Docker-compose up
Docker buildWrite/Edit
Run
Debug
Docker push
Integration
Registry
Production
Staging
Test
Container Workflow
Write/Edit
Run
Debug
CD
Scheduling
Orchestration
Local Development
Environment
CI/Build
Environment
SCC
Environment
• ASP.NET
• In Container Development
• Edit & Refresh
• Breakpoint Debugging
Integration
Azure Hosted
Private Registry*
Production
Staging
Test
Visual Studio Code
Write/Edit
Run
Debug
Visual Studio Team Services
• Source Code Control
• Build
• Continuous Integration
• 3rd Party Integration:
VSTS Build Agents w/ Docker
• VM Scale Sets
• Azure Container Service
• Azure Hosted Docker Private Registry
Azure Container Service
Visual Studio
• Docker Language Services
• Docker Scaffolding w/yo docker
public registry
ASP.NET
Orchestration&Scheduling-Marathon/DockerSwarm
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Dockerfile
Optimized release version. Validate locally, deployed to production
Dockerfile.debug
Local version, used for debugging
Docker-compose.yml
Deployed version, used to instance multiple containers
Docker-compose.yml.debug
Local version, used for debugging
DockerTask.ps1
PowerShell, to coordinate all the local operations. Similar to a makefile
Docker.targets & Docker.props
Used by Visual Studio to hook the F5 experience
Sets the docker host. Blank Machine for Docker for Windows*
launchSettings.json
Docker entry point added to enable running in a Docker Container.
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
http://aka.ms/DockerToolsForVSTS
Azure Container Service High AvailabilityHyper-Scale
Microservices
Container hosts
as cattle
Flexible
programming
models
Azure Private cloud Other clouds
Open Source
Orchestration
Host cluster
management
Open Source Container ManagementHigh Availability High Density
Placement
Constraints
Fast startup &
shutdown
Self-healing
•
•
•
•
•
Layer Supported Technologies
(2015)
Configuration as
Code
ARM, Dockerfile, Docker
Compose
Host cluster
management
VM Scale Sets
Container
orchestration
Docker Swarm, Chronos,
Marathon, Apache Mesos
Monitoring OMS, App Insights
aka.ms/DockerToolsForVS
aka.ms/DockerToolsForVSTS
aka.ms/DockerToolsForVSCode
aka.ms/yodocker
aka.ms/AzureContainerS
ervice
aka.ms/WindowsContain
ers
http://wannabeegeek.com

More Related Content

What's hot (20)

PPTX
Webinar: Development Swarm Cluster with Docker Compose V3
Codefresh
 
PPTX
Dockerize the World
damovsky
 
PDF
Docker multi-stage build
Alexei Ledenev
 
PPTX
Azure container service docker-ha noi com
Van Phuc
 
PDF
Deployment Automation with Docker
Egor Pushkin
 
PDF
Testing strategies for Docker containers
Alexei Ledenev
 
PPTX
Angular boilerplate generator
Vincent De Smet
 
PDF
Built in ci-cd with kubernetes, jenkins and helm
Pau López
 
PPTX
Intro Docker october 2013
dotCloud
 
PPTX
Intro to docker
Towfiqul Islam
 
PPTX
Docker lxc win
rahulmore01
 
PPTX
Develop with docker 2014 aug
Vincent De Smet
 
PDF
Build in continuous integration, delivery and deploy
Pau López
 
PDF
Optimizing Docker Images
Brian DeHamer
 
PDF
Auto deploy symfony app with codeship and elastic beanstalk
Alex Demchenko
 
PDF
Containerization using docker
WingChan46
 
PDF
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
dotCloud
 
PPTX
Containerization and Docker
Megha Bansal
 
PPTX
Developer South Coast 2018: Modernizing .NET Apps with Docker
Elton Stoneman
 
PDF
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Stefan Scherer
 
Webinar: Development Swarm Cluster with Docker Compose V3
Codefresh
 
Dockerize the World
damovsky
 
Docker multi-stage build
Alexei Ledenev
 
Azure container service docker-ha noi com
Van Phuc
 
Deployment Automation with Docker
Egor Pushkin
 
Testing strategies for Docker containers
Alexei Ledenev
 
Angular boilerplate generator
Vincent De Smet
 
Built in ci-cd with kubernetes, jenkins and helm
Pau López
 
Intro Docker october 2013
dotCloud
 
Intro to docker
Towfiqul Islam
 
Docker lxc win
rahulmore01
 
Develop with docker 2014 aug
Vincent De Smet
 
Build in continuous integration, delivery and deploy
Pau López
 
Optimizing Docker Images
Brian DeHamer
 
Auto deploy symfony app with codeship and elastic beanstalk
Alex Demchenko
 
Containerization using docker
WingChan46
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
dotCloud
 
Containerization and Docker
Megha Bansal
 
Developer South Coast 2018: Modernizing .NET Apps with Docker
Elton Stoneman
 
Bauen und Verteilen von Multi-Arch Docker Images für Linux und Windows
Stefan Scherer
 

Viewers also liked (20)

PDF
.NET Core on Mac
Melania Andrisan (Danciu)
 
PPT
My journey as a developer
Mehdi Khalili
 
PDF
Logística Urbana na Baixa Pombalina - Uma Solução Inteligente_Relatório
Luis Neto
 
PPTX
Automated UI Testing Done Right (QMSDNUG)
Mehdi Khalili
 
PPTX
ITerior - .NET Core, usando .NET no Linux!
Vinicius Mussak
 
PPT
Microservices lessons from trenches
Mehdi Khalili
 
PDF
Getting started with .net on openSUSE (asp.net with c#)
Alin Alifah
 
PPT
Microservices: lessons from the trenches
Mehdi Khalili
 
PPTX
Cross platform dotnet development using dotnet core
Swaminathan Vetri
 
PDF
Cobertura
Alessandra Barcelo
 
PPTX
Powershell For Developers
Ido Flatow
 
PDF
Getting Started .NET Core
Yuta Matsumura
 
PPTX
Automated UI testing done right (DDDSydney)
Mehdi Khalili
 
PPTX
Docker for .NET Developers
Taswar Bhatti
 
PPTX
Introduction to HTTP/2
Ido Flatow
 
PPTX
Debugging the Web with Fiddler
Ido Flatow
 
PPTX
Next .NET and C#
Bertrand Le Roy
 
PPTX
Lessons from running potentially malicious code inside containers
Ben Hall
 
PPTX
The How and Why of Windows containers
Ben Hall
 
PPTX
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
Ido Flatow
 
.NET Core on Mac
Melania Andrisan (Danciu)
 
My journey as a developer
Mehdi Khalili
 
Logística Urbana na Baixa Pombalina - Uma Solução Inteligente_Relatório
Luis Neto
 
Automated UI Testing Done Right (QMSDNUG)
Mehdi Khalili
 
ITerior - .NET Core, usando .NET no Linux!
Vinicius Mussak
 
Microservices lessons from trenches
Mehdi Khalili
 
Getting started with .net on openSUSE (asp.net with c#)
Alin Alifah
 
Microservices: lessons from the trenches
Mehdi Khalili
 
Cross platform dotnet development using dotnet core
Swaminathan Vetri
 
Powershell For Developers
Ido Flatow
 
Getting Started .NET Core
Yuta Matsumura
 
Automated UI testing done right (DDDSydney)
Mehdi Khalili
 
Docker for .NET Developers
Taswar Bhatti
 
Introduction to HTTP/2
Ido Flatow
 
Debugging the Web with Fiddler
Ido Flatow
 
Next .NET and C#
Bertrand Le Roy
 
Lessons from running potentially malicious code inside containers
Ben Hall
 
The How and Why of Windows containers
Ben Hall
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
Ido Flatow
 
Ad

Similar to Deploying .net core apps to Docker - dotnetConf Local Bengaluru (20)

PPTX
Container on azure
Vishwas N
 
PPTX
Azure ai on premises with docker
Vishwas N
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Docker
Tomy Rhymond
 
PPTX
You, and Me, and Docker Makes Three
Christopher Grayson
 
PPTX
Docker 101
Kevin Nord
 
PPTX
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Simplilearn
 
PPTX
Introduction to Containers and Docker
Fayçal Bziou
 
PDF
Docker how to
Patryk Omiotek
 
PDF
Docker intro
Frei Zhang
 
PDF
Cloud Native Computing - Part III - Containers
Linjith Kunnon
 
PDF
Introduction to Docker
Tharaka Devinda
 
PDF
Docker on azure
Anuraj P
 
PDF
Introduction to Docker - IndiaOpsUG
Ajeet Singh Raina
 
PDF
Docker basics
Claudio Montoya
 
PPTX
Windows server and docker
girish goudar
 
PDF
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
PDF
Experts Live Europe 2017 - Why you should care about Docker - an introduction
Marc Müller
 
PDF
Introduction to Docker Containers - Docker Captain
Ajeet Singh Raina
 
Container on azure
Vishwas N
 
Azure ai on premises with docker
Vishwas N
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Docker
Tomy Rhymond
 
You, and Me, and Docker Makes Three
Christopher Grayson
 
Docker 101
Kevin Nord
 
Docker Tutorial For Beginners | What Is Docker And How It Works? | Docker Tut...
Simplilearn
 
Introduction to Containers and Docker
Fayçal Bziou
 
Docker how to
Patryk Omiotek
 
Docker intro
Frei Zhang
 
Cloud Native Computing - Part III - Containers
Linjith Kunnon
 
Introduction to Docker
Tharaka Devinda
 
Docker on azure
Anuraj P
 
Introduction to Docker - IndiaOpsUG
Ajeet Singh Raina
 
Docker basics
Claudio Montoya
 
Windows server and docker
girish goudar
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Experts Live Europe 2017 - Why you should care about Docker - an introduction
Marc Müller
 
Introduction to Docker Containers - Docker Captain
Ajeet Singh Raina
 
Ad

More from Swaminathan Vetri (18)

PPTX
Getting Started with Azure AI Studio.pptx
Swaminathan Vetri
 
PPTX
Blueprint-for-designing-solutions-on-azure.pptx
Swaminathan Vetri
 
PPTX
Unlocking the potential of GitHub Copilot.pptx
Swaminathan Vetri
 
PPTX
Architecting multi-cloud ready applications
Swaminathan Vetri
 
PPTX
BDotNet - Microsoft Build 2023 After Party
Swaminathan Vetri
 
PPTX
AzureContainerAppswithDotNet_Pune_2022.pptx
Swaminathan Vetri
 
PPTX
Microservices and Service Mesh
Swaminathan Vetri
 
PPTX
Infrastructure automation with .NET
Swaminathan Vetri
 
PPTX
Azure infra automation using pulumi
Swaminathan Vetri
 
PPTX
CI/CD with GitHub Actions
Swaminathan Vetri
 
PPTX
Bye bye WCF, hello gRPC
Swaminathan Vetri
 
PPTX
Building cloud native apps
Swaminathan Vetri
 
PPTX
Azure dev ops
Swaminathan Vetri
 
PPTX
.Net Standard 2.0
Swaminathan Vetri
 
PPTX
Rapid mobile app development using Ionic framework
Swaminathan Vetri
 
PPTX
Entity Framework for Cross platform apps
Swaminathan Vetri
 
PPTX
Xamarin Dev Days - Intro to Xamarin
Swaminathan Vetri
 
PPTX
Getting Started with Ionic
Swaminathan Vetri
 
Getting Started with Azure AI Studio.pptx
Swaminathan Vetri
 
Blueprint-for-designing-solutions-on-azure.pptx
Swaminathan Vetri
 
Unlocking the potential of GitHub Copilot.pptx
Swaminathan Vetri
 
Architecting multi-cloud ready applications
Swaminathan Vetri
 
BDotNet - Microsoft Build 2023 After Party
Swaminathan Vetri
 
AzureContainerAppswithDotNet_Pune_2022.pptx
Swaminathan Vetri
 
Microservices and Service Mesh
Swaminathan Vetri
 
Infrastructure automation with .NET
Swaminathan Vetri
 
Azure infra automation using pulumi
Swaminathan Vetri
 
CI/CD with GitHub Actions
Swaminathan Vetri
 
Bye bye WCF, hello gRPC
Swaminathan Vetri
 
Building cloud native apps
Swaminathan Vetri
 
Azure dev ops
Swaminathan Vetri
 
.Net Standard 2.0
Swaminathan Vetri
 
Rapid mobile app development using Ionic framework
Swaminathan Vetri
 
Entity Framework for Cross platform apps
Swaminathan Vetri
 
Xamarin Dev Days - Intro to Xamarin
Swaminathan Vetri
 
Getting Started with Ionic
Swaminathan Vetri
 

Recently uploaded (20)

PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
“Computer Vision at Sea: Automated Fish Tracking for Sustainable Fishing,” a ...
Edge AI and Vision Alliance
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Digital Circuits, important subject in CS
contactparinay1
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 

Deploying .net core apps to Docker - dotnetConf Local Bengaluru

  • 3. Shipping Manifest The Big Picture for working with Containers Container Vocabulary Container Architecture Micro Services and Containerization .NET Core Visual Studio Visual Studio TeamServices Azure Container Service
  • 5. Host OS - Hardware Hyper Visor Guest OS #2 Start on Earth – Docker Hello-World • Docker Containers and VMs Guest OS #1 (Virtual Machine) Docker Daemon
  • 6. Server Host OS Hypervisor Server Host OS Docker Engine Guest OS Guest OS Guest OS Bins/Libs Bins/Libs Bins/Libs App A App A’ App B Bins/Libs Bins/Libs AppA AppA’ AppB AppB’ AppB AppB’ AppB AppB’ Containers are isolated, but share OS and, where appropriate, bins/libraries
  • 10. PS docker search microsoft NAME DESCRIPTION STARS OFFICIAL AUTOMATED microsoft/dotnet Preview images for the .NET Core command l... 107 [OK] microsoft/azure-cli Docker image for Microsoft Azure Command L... 52 [OK] microsoft/iis Internet Information Services (IIS) instal... 11 microsoft/oms Monitor your containers using the Operatio... 3 [OK] microsoft/applicationinsights Application Insights for Docker helps you ... 3 [OK] microsoft/sample-dotnet .NET Core running in a Nano Server container 1 microsoft/dotnet35 1 PS docker pull microsoft/dotnet Using default tag: latest latest: Pulling from microsoft/aspnet 604d05dfd165: Extracting [====================================================> ] 34.78 MB/37.19 MB a3ed95caeb02: Download complete af271166b5e5: Download complete ffff72610562: Pull complete 82633c2ea8fc: Pull complete 1ec63dc1715b: Downloading [=========================> ] 29.72 MB/64.67 MB 9be54d5ae146: Pull complete c3abf6246d6a: Pull complete Digest: sha256:cbbc0a7be0926d017ffd952799c4864c2c6cf812cbb70862bf2c8539401aa1e3 Status: Downloaded newer image for microsoft/dotnet:latest
  • 11. DOCKER_HOST Images CacheContainers RegistryClient Docker pull Docker daemon Docker run Docker API Dot Net Dot Net Dot Net Dot Net
  • 14. PS dotnet new PS Code . # add a docker file PS dotnet build –c release PS dotnet publish –c release –o app PS Docker build –t helloworld . Sending build context to Docker daemon 667.6 kB Step 1 : FROM microsoft/dotnet:1.0.0-rc2-core ---> c7a9cf9c81f5 Step 2 : WORKDIR /app ---> Using cache ---> eb9360aaf982 Step 3 : COPY /app /app ---> Using cache ---> 80e66eaa09e0 Step 4 : ENTRYPOINT dotnet DotNetHelloWorld.dll ---> Using cache ---> e559e0c38fbd Successfully built e559e0c38fbd PS docker images REPOSITORY TAG IMAGE ID CREATED SIZE helloworld latest ae30949a3358 5 seconds ago 242.4 MB PS docker run helloworld Hello World!
  • 15. Registry DOCKER_HOST ImagesContainers Docker build 0001Program.cs110 HelloWorld.dll 111010111011011010 Code/Binaries Client Docker build Docker daemon FROM microsoft/dotnet:latest WORKDIR /app COPY /app /app ENTRYPOINT dotnet HelloWorld.dll dockerfile Private Registry Docker run Docker push
  • 17. Vocabulary Host A VM running the Docker Daemon to host a collection of Docker Containers Image An ordered collection of filesystems* to be used when instancing a container Container A runtime instance of an image Registry A collection of docker images Dockerfile Commands to build a Docker image Tag A version identifier for an image, plus the registry name docker tag [registrypath]/image:[version] Commands Docker search Searches the current registry Docker pull Pulls a Docker Image to your Docker Host cache Docker run The process of instancing an Image as a running container Understanding the Docker Architecture
  • 20. PS docker run -it -v /c/Users/Swami:/wormhole busybox / # ls bin dev etc home proc root sys tmp usr var wormhole / # cd wormhole /wormhole # touch a.txt /wormhole # touch b.txt /wormhole # ls a.txt b.txt /wormhole # cat a.txt Hello from the other side of the wormhole /wormhole #
  • 22. Vocabulary Host A VM running the Docker Daemon to host a collection of Docker Containers Image An ordered collection of filesystems* to be used when instancing a container – * see layers, later on Container A runtime instance of an image Registry A collection of docker images Dockerfile Commands to build a Docker image Tag A version identifier for an image Volume A means to provide persistent storage from an immutable container Commands Docker run The process of instancing an Image as a running container Docker login Logs into the registry so you can push images Docker build Creates an image, using a dockerfile as the definition Docker tag Renames an image: [registryname]/[user]/[imagename]:[tag] Docker push Pushes an image to a registry Docker-compose Volumes
  • 24. PS docker-machine ls NAME ACTIVE DRIVER STATE URL DOCKER default - virtualbox Running tcp://docker v1/10.1 dockerhost-linux - azure Running tcp://dockerhost-linux.cloudapp.net:2376 v1.10.2 PS docker-machine env dockerhost-linux $Env:DOCKER_TLS_VERIFY = "1" $Env:DOCKER_HOST = "tcp://dockerhost-linux.cloudapp.net:2376" $Env:DOCKER_CERT_PATH = "C:UsersSteveLas.dockermachinemachinesdockerhost-linux" $Env:DOCKER_MACHINE_NAME = "dockerhost-linux" # Run this command to configure your shell: # Docker-machine env dockerhost-linux | Invoke-Expression PS docker-machine active dockerhost-linux PS docker-machine ip dockerhost-linux dockerhost-linux.cloudapp.net Note: Docker Machine not required when working with Docker for Windows
  • 25. PS docker-machine create -d azure --azure-subscription-id "[your azure sub id]" --azure-open-port 80 mydockerhost Docker Docs - Docker-machine create -d azure... Azure Docs - Docker-machine create -d azure ...
  • 26. Commands Docker Docs - Docker-machine create -d azure... Azure Docs - Docker-machine create -d azure ...
  • 31. • ASP.NET • In Container Development • Edit & Refresh • Breakpoint Debugging Integration Azure Hosted Private Registry* Production Staging Test Visual Studio Code Write/Edit Run Debug Visual Studio Team Services • Source Code Control • Build • Continuous Integration • 3rd Party Integration: VSTS Build Agents w/ Docker • VM Scale Sets • Azure Container Service • Azure Hosted Docker Private Registry Azure Container Service Visual Studio • Docker Language Services • Docker Scaffolding w/yo docker public registry ASP.NET Orchestration&Scheduling-Marathon/DockerSwarm
  • 34. Dockerfile Optimized release version. Validate locally, deployed to production Dockerfile.debug Local version, used for debugging Docker-compose.yml Deployed version, used to instance multiple containers Docker-compose.yml.debug Local version, used for debugging DockerTask.ps1 PowerShell, to coordinate all the local operations. Similar to a makefile Docker.targets & Docker.props Used by Visual Studio to hook the F5 experience Sets the docker host. Blank Machine for Docker for Windows* launchSettings.json Docker entry point added to enable running in a Docker Container.
  • 37. Azure Container Service High AvailabilityHyper-Scale Microservices Container hosts as cattle Flexible programming models Azure Private cloud Other clouds Open Source Orchestration Host cluster management Open Source Container ManagementHigh Availability High Density Placement Constraints Fast startup & shutdown Self-healing
  • 38. • • • • • Layer Supported Technologies (2015) Configuration as Code ARM, Dockerfile, Docker Compose Host cluster management VM Scale Sets Container orchestration Docker Swarm, Chronos, Marathon, Apache Mesos Monitoring OMS, App Insights

Editor's Notes

  • #39: Azure Container Service focusses on the configuration and management of the hosting infrastructure. We also provide key open source orchestration technologies. ACS does not provide an application development model. This has some advantages (e.g. more flexibility in application architecture) but some disadvantages (e.g. stateful applications need to be designed to manage their own state)