Slide 1

Slide 1 text

Technology that unlocks the value of your professional audience Docker for .NET Developers Steve Gordon - Senior Software Developer Madgex Ltd Blog: stevejgordon.co.uk Twitter: @stevejgordon

Slide 2

Slide 2 text

Technology that unlocks the value of your professional audience What we’ll cover • Our journey To Docker • Why use Docker? • What is Docker? • dockerfiles and docker-compose • Using Jenkins for builds • Running containers on AWS ECS

Slide 3

Slide 3 text

Technology that unlocks the value of your professional audience What is Docker? • Containerisation and application platform • Images are lightweight, standalone packages for an application • Package includes all dependencies as a single unit of deployment • Containers run securely and in isolation • Frictionless development and deployment

Slide 4

Slide 4 text

Technology that unlocks the value of your professional audience Lightweight Significantly smaller resource footprint Small unit of deployment Smaller file size Containers vs. Virtual Machines SERVER HOST OS HYPERVISOR GUEST OS GUEST OS BINS / LIBS BINS / LIBS APP B APP A SERVER HOST OS DOCKER ENGINE BINS / LIBS APP A BINS / LIBS APP C BINS / LIBS APP B Reliability Trust that what worked locally will work in production Fast start-up Can start in under 1 second

Slide 5

Slide 5 text

Technology that unlocks the value of your professional audience Microservice based Single responsibility. Discrete scaling .NET Core & ASP.NET Core Cross platform. Improved performance API driven SPA ASP.NET Core APIs Madgex Insights

Slide 6

Slide 6 text

Technology that unlocks the value of your professional audience Insights Architecture FRONT END SPA USER API SCHEDULE API REPORT API QUERY API ELASTICSEARCH

Slide 7

Slide 7 text

Technology that unlocks the value of your professional audience Motivation 1: Developer Workflow PULL CLIENT PROJECT PULL PLATFORM BUILD x2 EDIT DOCKER-COMPOSE PULL EDIT DOCKER-COMPOSE UP -D

Slide 8

Slide 8 text

Technology that unlocks the value of your professional audience “This is amazing!” James Wragg (Senior Front End Developer at Madgex)

Slide 9

Slide 9 text

Technology that unlocks the value of your professional audience Demo dockerfiles Building and running an image

Slide 10

Slide 10 text

Technology that unlocks the value of your professional audience Anatomy of an image OS FILE SYSTEM – DEBIAN DEPENDENCIES (PACKAGES) - CURL DEPENDENCIES (PACKAGES) - SCM .NET CORE SDK AND CLI ASP.NET CORE NUGET PACKAGE CACHE YOUR ASP.NET APPLICATION SCRATCH

Slide 11

Slide 11 text

Technology that unlocks the value of your professional audience Demo docker-compose Build and run multiple images

Slide 12

Slide 12 text

Technology that unlocks the value of your professional audience Motivation 2: Deployments AWS ECR AWS ECS PRODUCTION

Slide 13

Slide 13 text

Technology that unlocks the value of your professional audience Amazon ECS Services Manage how tasks run and scale. ALB CLUSTER EC2 INSTANCE ECS AGENT TASK A TASK B EC2 INSTANCE ECS AGENT TASK A TASK B TASK B SERVICE A Desired Count = 2 Task Def = Task Def A SERVICE B Desired Count = 4 Task Def = Task Def B Task Definition A recipe to execute your application TASK B ECS is a Managed Service No patching or maintenance Cluster Logical grouping of EC2 instances ALB Share a single ALB with path routing to multiple services Task A running instance of a task definition

Slide 14

Slide 14 text

Technology that unlocks the value of your professional audience Demo Deploying to AWS ECS using Docker and Jenkins

Slide 15

Slide 15 text

Technology that unlocks the value of your professional audience Challenges and lessons learnt • There is a learning curve… but it's shallow at first • Start with basic dockerfiles - Innovate in stages • Get started just by using a pre-built image e.g. Postgres • Amazon ECS a little complex • Use CloudFormation to define ECS environments • Vendor Lock • Logging • Placement of containers – Balance memory/memory reservation

Slide 16

Slide 16 text

Technology that unlocks the value of your professional audience Benefits • Improved developer productivity and reduced onboarding time • No more "it runs on my machine" arguments • Dependable deployments • Simple build and deploy process • Zero downtime, fast, continuous deployments • Lower costs

Slide 17

Slide 17 text

Technology that unlocks the value of your professional audience Thank you Steve Gordon @stevejgordon stevejgordon.co.uk https://www.meetup.com/dotnetsoutheast