ASP.NET 5 einfach deployen mit Docker
Alexander Zeitler
Solution Architect und Entwickler bei PDMLab
Microsoft MVP für ASP.NET
ASP.NET Web API / Microsoft Azure Advisor
Agenda
- Microservices
- Herausforderungen
- Wie hilft Docker?
- ASP.NET 5 mit Docker deployen
Microservices
In computing, microservices is a software architecture style, in which complex applications are composed of small, independent processes communicating with each other using language-agnostic APIs.
These services are small, highly decoupled and focus on doing a small task.
Beispiel: E-Commerce
- Web Front-End
- Product Data Management (PDM)
- Lager
- Einkauf
- Versand
- Payment-Dienstleister
- Rechnungs- und Mahnwesen
- Identity
Vorteile
- Verschiedene Plattformen für verschiedene Services
- Austausch / Refactoring von Services einfacher
- Entkopplung beim Deployment
- "Two-Pizza"-Regel umsetzbar
- (Code) Ownership einfacher
Herausforderung:
Komplexität
Komplexität
- Significant Operations Overhead
- Substantial DevOps Skills Required
- Implicit Interfaces
- Duplication Of Effort
- Distributed System Complexity
- Asynchronicity Is Difficult!
- Testability Challenges
Anforderungen an Deployment
- Schnell
- Zuverlässig
- Reproduzierbar
Deployment automatisieren!
Wie hilft Docker?
Build, ship and run any application anywhere
vs...
Put it in a Container
Build
Package application in a container
Ship
Move container to another machine
Run
Execute that container
Any Application
All applications running on Linux
Anywhere
VM on premise, cloud, bare metal
Build
Dockerfile
FROM ubuntu:14.04
MAINTAINER Docker Team <education@docker.com>
RUN apt-get update
RUN apt-get install -y nginx
RUN echo 'Hi, I am your father...erm in your container' \
>/usr/share/nginx/html/index.html
CMD [ "nginx", "-g", "daemon off;" ]
EXPOSE 80
Ship
Docker Hub
Image name <username>/<reponame>
z.B. microsoft/aspnet
docker push
docker pull
Run
- Leichtgewichtig
- Schnell
Wie schnell?
Benchmark
$ time sudo docker run ubuntu echo hello world
Docker Footprint
$ sudo docker images
$ sudo docker history <CID>
Any application
- Web apps
- API backends
- Datenbanken (SQL, NoSQL)
- Big data
- Message queues
- ...
Runs on Linux == Runs in Docker
Windows Container?
Nano Server
Getting started
curl -sSL https://get.docker.com/ | sh
Try
On OS X / Windows
On Linux
Install
ASP.NET 5 in Docker
microsoft/aspnet
Demo
ASP.NET 5 in Docker
Next Steps
- Docker Machine
- Docker Compose
- Docker Swarm
Docker Machine
$ docker-machine create --driver virtualbox dev
Docker Compose
web:
build: .
links:
- db
ports:
- "8000:8000"
db:
image: postgres
Fragen?
Danke!
ASP.NET 5 einfach deployen mit Docker
By Alexander Zeitler
ASP.NET 5 einfach deployen mit Docker
- 1,402