Deploying ASP.Net Core apps in Docker Containers

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)

Transcript of Deploying ASP.Net Core apps in Docker Containers

  1. 1. Host OS - Hardware Hyper Visor Guest OS #2Guest OS #1 (Virtual Machine) Docker Daemon
  2. 2. App A Server Host OS Hypervisor Guest OS Guest OS Guest OS Bins/Lib s Bins/Lib s Bins/Lib s App A App B Server Host OS Docker Engine Bins/Libs Bins/Libs AppA AppA AppB AppB AppB AppB AppB AppB Containers are isolated, but share OS and, where appropriate, bins/libraries
  3. 3.
  4. 4. DOCKER_HOST Images CacheContainers RegistryClient Docker pull Docker daemon Docker run Docker API Dot Net Dot Net Dot Net Dot Net
  5. 5. docker build Registry DOCKER_HOST ImagesContainers 0001Program.cs110 HelloWorld.dll 111010111011011010 Code/Binaries Client Docker build Docker daemon FROM microsoft/dotnet:1.0.0-rc2-core WORKDIR /app COPY /app /app ENTRYPOINT dotnet HelloWorld.dll dockerfile Private Registry Docker run Docker push
  6. 6. Docker Compose Private Registry Multi Service API Multi Service DOCKER_HOST ImagesContainers Registry Client Docker-compose Docker daemon version: '2' services: multiservice: image: - multiservice:latest environment: - CustomerAPIService=http://webapi/api/Customer ports: - "80:80" depends_on: - webapi webapi: image: - multiserviceapi:latest Docker-compose.yml Dot Net Multi Service Multi Service API front end api Multi Service Multi Service API
  7. 7. Host OS Networking DOCKER_HOST Container1 Docker daemon docker0: :80 :8001 :8002 :8003 eth0: Container2 eth0: Container3 eth0: Container4 eth0: eth0: veth5998974veth473629a veth2726149bveth736321c Docker Networking uses NAT to route inbound traffic to each container Each container can use the same port, internal to its container, but must be addressable outside by unique ports per HOST Load Balancers and Service Discovery are new important topics Note: networking may vary based on your orchestration engine