SlideShare une entreprise Scribd logo
1  sur  62
Télécharger pour lire hors ligne
Taking Docker to
Production
Bret Fisher
DevOps Consultant

Docker Captain

Author of Udemy Docker Mastery
Add
picture
here
Why Are We Here?
● Want Docker in production
● Want to orchestrate containers
● Need to make educated project decisions
● Learn which requirements could be optional
● Learn 80's/90's video games
● Hear bad analogies relating retro games to Docker
A Bit About Me
●Geek since 5th Grade
●IT Sysadmin+Dev since 1994
●Owned *REAL* Atari 2600, NES, SNES, Sega
Genesis, Sinclair, TRS-80, Packard Bell 386
●Like Geek Trivia. Lets Have Some!
Project Docker
Super Project Advice Special Turbo Champion Edition
Limit Your Simultaneous Innovation
● Many initial container projects are too big in scope
● Solutions you maybe don't need day one:
○ Fully automatic CI/CD
○ Dynamic performance scaling
○ Containerizing all or nothing
○ Starting with persistent data
Legacy Apps Work In Containers Too
● Microservice conversion isn't required
● 12 Factor is a horizon we're always chasing
● Don't let these ideals delay containerization
Dockerfile Power-Ups
What To Focus On First: Dockerfiles
●More important than fancy orchestration
●It's your new build and environment
documentation
●Study Dockerfile/ENTRYPOINT of Hub
Officials
●FROM Official distros that are most familiar
Dockerfile Maturity Model
●Make it start
●Make it log all things to stdout/stderr
●Make it documented in file
●Make it work for others
●Make it lean
●Make it scale
Dockerfile
Anti-patterns
Dockerfile Anti-pattern: Trapping Data
● Problem: Storing unique data in container
● Solution: Define VOLUME for each location
Dockerfile Anti-pattern: Using Latest
● Latest = Image builds will be ¯_(ツ)_/¯
● Problem: Image builds pull FROM
latest
● Solution: Use specific FROM tags
● Problem: Image builds install latest
packages
● Solution: Specify version for critical
apt/yum/apk packages
Dockerfile Anti-pattern: Leaving Default Config
● Problem: Not changing app defaults, or blindly copying VM conf
○ e.g. php.ini, mysql.conf.d, java memory
● Solution: Update default configs via ENV, RUN, and ENTRYPOINT
Dockerfile Anti-pattern: Environment Specific
● Problem: Copy in environment config at image build
● Solution: Single Dockerfile with default ENV's, and
overwrite per-environment with ENTRYPOINT script
Lets Slay Some Infrastructure Dragons
The Big 3 Decisions
Containers-on-VM or Container-on-Bare-Metal
●Do either, or both. Lots of pros/cons to either
●Stick with what you know at first
●Do some basic performance testing. You will learn lots!
●2017 Docker Inc. and HPE whitepaper on MySQL benchmark
○(authored by yours truly, and others)
○bretfisher.com/dockercon17eu
OS Linux Distribution/Kernel Matters
● Docker is very kernel and storage driver dependent
● Innovations/fixes are still happening here
● "Minimum" version != "best" version
● No pre-existing opinion? Ubuntu 16.04 LTS
○ Popular, well-tested with Docker
○ 4.x Kernel and wide storage driver support
● Or InfraKit and LinuxKit!
● Get correct Docker for your distro from store.docker.com
Container Base Distribution: Which One?
● Which FROM image should you use?
● Don't make a decision based on image size (remember it's
Single Instance Storage)
● At first: match your existing deployment process
● Consider changing to Alpine later, maybe much later
Build Your Empire Swarm
Good Defaults: Swarm Architectures
● Simple sizing guidelines based off:
○ Docker internal testing
○ Docker reference architectures
○ Real world deployments
○ Swarm3k lessons learned
Baby Swarm: 1-Node
●"docker swarm init" done!
●Solo VM's do it, so can
Swarm
●Gives you more features
then docker run
HA Swarm: 3-Node
●Minimum for HA
●All Managers
●One node can fail
●Use when very small budget
●Pet projects or Test/CI
Biz Swarm: 5-Node
●Better high-availability
●All Managers
●Two nodes can fail
●My minimum for uptime that
affects $$$
Flexy Swarm: 10+ Nodes
●5 dedicated Managers
●Workers in DMZ
●Anything beyond 5 nodes, stick with
5 Managers and rest Workers
●Control container placement with
labels + constraints
Swole Swarm: 100+ Nodes
●5 dedicated managers
●Resize Managers as you grow
●Multiple Worker subnets on
Private/DMZ
●Control container placement with
labels + constraints
Don't Turn Cattle into Pets
● Assume nodes will be replaced
● Assume containers will be recreated
● Docker for (AWS/Azure) does this
● LinuxKit and InfraKit expect it
Reasons for Multiple Swarms
Bad Reasons
● Different hardware
configurations (or OS!)
● Different subnets or
security groups
● Different availability zones
●Security boundaries for
compliance
Good Reasons
● Learning: Run Stuff on Test
Swarm
● Geographical boundaries
● Management boundaries
using Docker API (or Docker
EE RBAC, or other auth plugin)
What About Windows Server 2016 Swarm?
●Hard to be "Windows Only Swarm", mix with Linux nodes
●Much of those tools are Linux only
●Windows = Less choice, but easier path
●My recommendation:
○Managers on Linux
○Reserve Windows for Windows-exclusive workloads
Bring In
Reinforcements
Outsource Well-Defined Plumbing
● Beware the "not implemented here" syndrome
● If challenge to implement and maintain
● + SaaS/commercial market is mature
● = Opportunities for outsourcing
Outsourcing: For Your Consideration
●Image registry
●Logs
●Monitoring and alerting
● Tools/Projects: https://github.com/cncf/landscape
Tech Stacks
Designs for a full-featured cluster
Pure Open Source Self-Hosted Tech Stack
Swarm GUI Portainer
Central Monitoring Prometheus + Grafana
Central Logging ELK
Layer 7 Proxy Flow-Proxy Traefik
Registry Docker Distribution + Portus
CI/CD Jenkins
Storage REX-Ray
Networking Docker Swarm
Orchestration Docker Swarm
Runtime Docker
HW / OS InfraKit Terraform
Also
Functions As A Service:
OpenFaaS
Docker for X: Cheap and Easy Tech Stack
Swarm GUI Portainer
Central Monitoring Librato Sysdig
Central Logging Docker for AWS/Azure
Layer 7 Proxy Flow-Proxy Traefik
Registry Docker Hub Quay
CI/CD Codeship TravisCI
Storage Docker for AWS/Azure
Networking Docker Swarm
Orchestration Docker Swarm
Runtime Docker
HW / OS Docker for AWS/Azure
Docker Enterprise Edition + Docker for X
Swarm GUI Docker EE (UCP)
Central Monitoring Librato Sysdig
Central Logging Docker for AWS/Azure
Layer 7 Proxy Docker EE (UCP)
Registry Docker EE (DTR)
CI/CD Codeship TravisCI
Storage Docker for AWS/Azure
Networking Docker Swarm
Orchestration Docker Swarm
Runtime Docker EE
HW / OS Docker for AWS/Azure
Also
Image Security Scanning
Role-Based Access Cont
Image Promotion
Content Trust
Ready Player One?
4 Can Co-Op,
But 1 Plays

Just Fine
Must We Have An Orchestrator?
● Let's accelerate your docker migration even more
● Already have good infrastructure automation?
● Maybe you have great VM autoscale?
● Like the security boundary of the VM OS?
One Container Per VM
● Why don't we talk about this more?
● Least amount of infrastructure change but also:
○ Run on Dockerfiles recipes rather then Puppet etc.
○ Improve your Docker management skills
○ Simplify your VM OS build
One Container Per VM: Not New
● Windows is doing it with Hyper-V Containers
● Linux is doing it with Intel Clear Containers
● LinuxKit will make this easier: Immutable OS
● Watch out for Windows "LCOW" using LinuxKit
Summary
●Trim the optional requirements at first
●First, focus on Dockerfile/docker-compose.yml
●Watch out for Dockerfile anti-patterns
●Stick with familiar OS and FROM images
●Grow Swarm as you grow
●Find ways to outsource plumbing
●Realize parts of your tech stack may change, stay flexible
Give Session Feedback in App!
● Help me come back next year
😬
Thank You!



Slides: bretfisher.com/dockercon17eu

●My Bestselling Docker Mastery Video Course
○90% off for DockerCon
○bretfisher.com/dockermastery
Honorable Mentions
●Metroid ('83 NES)
●Mega Man ('87 NES)
●Wolfenstein 3D ('92 PC)
●Homeworld ('99 PC)
●Legend Of Zelda ('86
NES)
●Mortal Kombat ('92)
●Doom/Quake ('93 PC)
●Contra/Castlevania ('86 NES)
● Hitchhiker's GTTG ('84
TRS-80)
●Zenophobe ('87 Arcade)
●Battlezone ('80 Arcade)

Contenu connexe

Tendances

Docker on Google App Engine
Docker on Google App EngineDocker on Google App Engine
Docker on Google App Engine
Docker, Inc.
 

Tendances (20)

Docker Platform Internals: Taking runtimes and image creation to the next lev...
Docker Platform Internals: Taking runtimes and image creation to the next lev...Docker Platform Internals: Taking runtimes and image creation to the next lev...
Docker Platform Internals: Taking runtimes and image creation to the next lev...
 
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun guptaDocker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun gupta
 
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
 
Docker on Google App Engine
Docker on Google App EngineDocker on Google App Engine
Docker on Google App Engine
 
Windows Server Containers- How we hot here and architecture deep dive
Windows Server Containers- How we hot here and architecture deep diveWindows Server Containers- How we hot here and architecture deep dive
Windows Server Containers- How we hot here and architecture deep dive
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Docker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT InfrastructureDocker for any type of workload and any IT Infrastructure
Docker for any type of workload and any IT Infrastructure
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
 
Docker Multi-arch All The Things
Docker Multi-arch All The ThingsDocker Multi-arch All The Things
Docker Multi-arch All The Things
 
ContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with DockerContainerDayVietnam2016: Django Development with Docker
ContainerDayVietnam2016: Django Development with Docker
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!DockerCon EU 2015: Stop Being Lazy and Test Your Software!
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
 
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
DCEU 18: Use Cases and Practical Solutions for Docker Container Storage on Sw...
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
Docker on Docker
Docker on DockerDocker on Docker
Docker on Docker
 
Docker?!?! But I'm a SysAdmin
Docker?!?! But I'm a SysAdminDocker?!?! But I'm a SysAdmin
Docker?!?! But I'm a SysAdmin
 
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena TapiaFrom Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
 
What’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, DockerWhat’s New in Docker - Victor Vieux, Docker
What’s New in Docker - Victor Vieux, Docker
 
DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker Engine
 
Building Your Docker Swarm Tech Stack
Building Your Docker Swarm Tech StackBuilding Your Docker Swarm Tech Stack
Building Your Docker Swarm Tech Stack
 

En vedette

My Journey To Go
My Journey To GoMy Journey To Go
My Journey To Go
Docker, Inc.
 

En vedette (20)

How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
How and Why Prometheus' New Storage Engine Pushes the Limits of Time Series D...
 
What's New in Docker
What's New in DockerWhat's New in Docker
What's New in Docker
 
The Value Of Diverse Experiences
The Value Of Diverse ExperiencesThe Value Of Diverse Experiences
The Value Of Diverse Experiences
 
Learning Docker from Square One
Learning Docker from Square OneLearning Docker from Square One
Learning Docker from Square One
 
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT SystemsIntegrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
 
A Strong Belief, Loosely Held: Bringing Empathy to IT
A Strong Belief, Loosely Held: Bringing Empathy to ITA Strong Belief, Loosely Held: Bringing Empathy to IT
A Strong Belief, Loosely Held: Bringing Empathy to IT
 
Troubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support EngineerTroubleshooting Tips from a Docker Support Engineer
Troubleshooting Tips from a Docker Support Engineer
 
Container Storage Best Practices in 2017
Container Storage Best Practices in 2017Container Storage Best Practices in 2017
Container Storage Best Practices in 2017
 
Kubernetes in Docker
Kubernetes in DockerKubernetes in Docker
Kubernetes in Docker
 
Back to the Future: Containerize Legacy Applications
Back to the Future: Containerize Legacy ApplicationsBack to the Future: Containerize Legacy Applications
Back to the Future: Containerize Legacy Applications
 
My Journey To Go
My Journey To GoMy Journey To Go
My Journey To Go
 
The Truth Behind Serverless
The Truth Behind ServerlessThe Truth Behind Serverless
The Truth Behind Serverless
 
Docker to the Rescue of an Ops Team
Docker to the Rescue of an Ops TeamDocker to the Rescue of an Ops Team
Docker to the Rescue of an Ops Team
 
Repainting the Past with Distributed Machine Learning and Docker
Repainting the Past with Distributed Machine Learning and DockerRepainting the Past with Distributed Machine Learning and Docker
Repainting the Past with Distributed Machine Learning and Docker
 
Android Meets Docker
Android Meets DockerAndroid Meets Docker
Android Meets Docker
 
The Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build ScriptThe Fairy Tale of the One Command Build Script
The Fairy Tale of the One Command Build Script
 
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPFCilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
Cilium: Kernel Native Security & DDOS Mitigation for Microservices with BPF
 
Looking Under The Hood: containerD
Looking Under The Hood: containerDLooking Under The Hood: containerD
Looking Under The Hood: containerD
 
Skynet vs. Planet of The Apes: Duel!
Skynet vs. Planet of The Apes: Duel!Skynet vs. Planet of The Apes: Duel!
Skynet vs. Planet of The Apes: Duel!
 
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-ComposeTales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
Tales of Training: Scaling CodeLabs with Swarm Mode and Docker-Compose
 

Similaire à Taking Docker to Production: What You Need to Know and Decide

A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
Docker, Inc.
 

Similaire à Taking Docker to Production: What You Need to Know and Decide (20)

ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
 
Container Days
Container DaysContainer Days
Container Days
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
 
Going Production with Docker and Swarm
Going Production with Docker and SwarmGoing Production with Docker and Swarm
Going Production with Docker and Swarm
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
Talk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about DockerTalk on PHP Day Uruguay about Docker
Talk on PHP Day Uruguay about Docker
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Containers not just for production nov8
Containers not just for production nov8Containers not just for production nov8
Containers not just for production nov8
 
Truemotion Adventures in Containerization
Truemotion Adventures in ContainerizationTruemotion Adventures in Containerization
Truemotion Adventures in Containerization
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Introduction to Containers
Introduction to ContainersIntroduction to Containers
Introduction to Containers
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 

Plus de Docker, Inc.

Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
Docker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
Docker, Inc.
 

Plus de Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 
Sharing is Caring: How to Begin Speaking at Conferences
Sharing is Caring: How to Begin Speaking at ConferencesSharing is Caring: How to Begin Speaking at Conferences
Sharing is Caring: How to Begin Speaking at Conferences
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

Taking Docker to Production: What You Need to Know and Decide

  • 1. Taking Docker to Production Bret Fisher DevOps Consultant
 Docker Captain
 Author of Udemy Docker Mastery Add picture here
  • 2. Why Are We Here? ● Want Docker in production ● Want to orchestrate containers ● Need to make educated project decisions ● Learn which requirements could be optional ● Learn 80's/90's video games ● Hear bad analogies relating retro games to Docker
  • 3. A Bit About Me ●Geek since 5th Grade ●IT Sysadmin+Dev since 1994 ●Owned *REAL* Atari 2600, NES, SNES, Sega Genesis, Sinclair, TRS-80, Packard Bell 386 ●Like Geek Trivia. Lets Have Some!
  • 4.
  • 5.
  • 6.
  • 7. Project Docker Super Project Advice Special Turbo Champion Edition
  • 8. Limit Your Simultaneous Innovation ● Many initial container projects are too big in scope ● Solutions you maybe don't need day one: ○ Fully automatic CI/CD ○ Dynamic performance scaling ○ Containerizing all or nothing ○ Starting with persistent data
  • 9. Legacy Apps Work In Containers Too ● Microservice conversion isn't required ● 12 Factor is a horizon we're always chasing ● Don't let these ideals delay containerization
  • 11. What To Focus On First: Dockerfiles ●More important than fancy orchestration ●It's your new build and environment documentation ●Study Dockerfile/ENTRYPOINT of Hub Officials ●FROM Official distros that are most familiar
  • 12. Dockerfile Maturity Model ●Make it start ●Make it log all things to stdout/stderr ●Make it documented in file ●Make it work for others ●Make it lean ●Make it scale
  • 13.
  • 14.
  • 15.
  • 17. Dockerfile Anti-pattern: Trapping Data ● Problem: Storing unique data in container ● Solution: Define VOLUME for each location
  • 18. Dockerfile Anti-pattern: Using Latest ● Latest = Image builds will be ¯_(ツ)_/¯ ● Problem: Image builds pull FROM latest ● Solution: Use specific FROM tags ● Problem: Image builds install latest packages ● Solution: Specify version for critical apt/yum/apk packages
  • 19. Dockerfile Anti-pattern: Leaving Default Config ● Problem: Not changing app defaults, or blindly copying VM conf ○ e.g. php.ini, mysql.conf.d, java memory ● Solution: Update default configs via ENV, RUN, and ENTRYPOINT
  • 20. Dockerfile Anti-pattern: Environment Specific ● Problem: Copy in environment config at image build ● Solution: Single Dockerfile with default ENV's, and overwrite per-environment with ENTRYPOINT script
  • 21.
  • 22.
  • 23.
  • 24. Lets Slay Some Infrastructure Dragons The Big 3 Decisions
  • 25. Containers-on-VM or Container-on-Bare-Metal ●Do either, or both. Lots of pros/cons to either ●Stick with what you know at first ●Do some basic performance testing. You will learn lots! ●2017 Docker Inc. and HPE whitepaper on MySQL benchmark ○(authored by yours truly, and others) ○bretfisher.com/dockercon17eu
  • 26. OS Linux Distribution/Kernel Matters ● Docker is very kernel and storage driver dependent ● Innovations/fixes are still happening here ● "Minimum" version != "best" version ● No pre-existing opinion? Ubuntu 16.04 LTS ○ Popular, well-tested with Docker ○ 4.x Kernel and wide storage driver support ● Or InfraKit and LinuxKit! ● Get correct Docker for your distro from store.docker.com
  • 27. Container Base Distribution: Which One? ● Which FROM image should you use? ● Don't make a decision based on image size (remember it's Single Instance Storage) ● At first: match your existing deployment process ● Consider changing to Alpine later, maybe much later
  • 28.
  • 30. Good Defaults: Swarm Architectures ● Simple sizing guidelines based off: ○ Docker internal testing ○ Docker reference architectures ○ Real world deployments ○ Swarm3k lessons learned
  • 31. Baby Swarm: 1-Node ●"docker swarm init" done! ●Solo VM's do it, so can Swarm ●Gives you more features then docker run
  • 32. HA Swarm: 3-Node ●Minimum for HA ●All Managers ●One node can fail ●Use when very small budget ●Pet projects or Test/CI
  • 33. Biz Swarm: 5-Node ●Better high-availability ●All Managers ●Two nodes can fail ●My minimum for uptime that affects $$$
  • 34. Flexy Swarm: 10+ Nodes ●5 dedicated Managers ●Workers in DMZ ●Anything beyond 5 nodes, stick with 5 Managers and rest Workers ●Control container placement with labels + constraints
  • 35. Swole Swarm: 100+ Nodes ●5 dedicated managers ●Resize Managers as you grow ●Multiple Worker subnets on Private/DMZ ●Control container placement with labels + constraints
  • 36. Don't Turn Cattle into Pets ● Assume nodes will be replaced ● Assume containers will be recreated ● Docker for (AWS/Azure) does this ● LinuxKit and InfraKit expect it
  • 37. Reasons for Multiple Swarms Bad Reasons ● Different hardware configurations (or OS!) ● Different subnets or security groups ● Different availability zones ●Security boundaries for compliance Good Reasons ● Learning: Run Stuff on Test Swarm ● Geographical boundaries ● Management boundaries using Docker API (or Docker EE RBAC, or other auth plugin)
  • 38. What About Windows Server 2016 Swarm? ●Hard to be "Windows Only Swarm", mix with Linux nodes ●Much of those tools are Linux only ●Windows = Less choice, but easier path ●My recommendation: ○Managers on Linux ○Reserve Windows for Windows-exclusive workloads
  • 39.
  • 40.
  • 42. Outsource Well-Defined Plumbing ● Beware the "not implemented here" syndrome ● If challenge to implement and maintain ● + SaaS/commercial market is mature ● = Opportunities for outsourcing
  • 43. Outsourcing: For Your Consideration ●Image registry ●Logs ●Monitoring and alerting ● Tools/Projects: https://github.com/cncf/landscape
  • 44. Tech Stacks Designs for a full-featured cluster
  • 45. Pure Open Source Self-Hosted Tech Stack Swarm GUI Portainer Central Monitoring Prometheus + Grafana Central Logging ELK Layer 7 Proxy Flow-Proxy Traefik Registry Docker Distribution + Portus CI/CD Jenkins Storage REX-Ray Networking Docker Swarm Orchestration Docker Swarm Runtime Docker HW / OS InfraKit Terraform Also Functions As A Service: OpenFaaS
  • 46. Docker for X: Cheap and Easy Tech Stack Swarm GUI Portainer Central Monitoring Librato Sysdig Central Logging Docker for AWS/Azure Layer 7 Proxy Flow-Proxy Traefik Registry Docker Hub Quay CI/CD Codeship TravisCI Storage Docker for AWS/Azure Networking Docker Swarm Orchestration Docker Swarm Runtime Docker HW / OS Docker for AWS/Azure
  • 47. Docker Enterprise Edition + Docker for X Swarm GUI Docker EE (UCP) Central Monitoring Librato Sysdig Central Logging Docker for AWS/Azure Layer 7 Proxy Docker EE (UCP) Registry Docker EE (DTR) CI/CD Codeship TravisCI Storage Docker for AWS/Azure Networking Docker Swarm Orchestration Docker Swarm Runtime Docker EE HW / OS Docker for AWS/Azure Also Image Security Scanning Role-Based Access Cont Image Promotion Content Trust
  • 48.
  • 49.
  • 51.
  • 52. 4 Can Co-Op, But 1 Plays
 Just Fine
  • 53. Must We Have An Orchestrator? ● Let's accelerate your docker migration even more ● Already have good infrastructure automation? ● Maybe you have great VM autoscale? ● Like the security boundary of the VM OS?
  • 54. One Container Per VM ● Why don't we talk about this more? ● Least amount of infrastructure change but also: ○ Run on Dockerfiles recipes rather then Puppet etc. ○ Improve your Docker management skills ○ Simplify your VM OS build
  • 55. One Container Per VM: Not New ● Windows is doing it with Hyper-V Containers ● Linux is doing it with Intel Clear Containers ● LinuxKit will make this easier: Immutable OS ● Watch out for Windows "LCOW" using LinuxKit
  • 56.
  • 57.
  • 58.
  • 59. Summary ●Trim the optional requirements at first ●First, focus on Dockerfile/docker-compose.yml ●Watch out for Dockerfile anti-patterns ●Stick with familiar OS and FROM images ●Grow Swarm as you grow ●Find ways to outsource plumbing ●Realize parts of your tech stack may change, stay flexible
  • 60. Give Session Feedback in App! ● Help me come back next year 😬
  • 61. Thank You!
 
 Slides: bretfisher.com/dockercon17eu
 ●My Bestselling Docker Mastery Video Course ○90% off for DockerCon ○bretfisher.com/dockermastery
  • 62. Honorable Mentions ●Metroid ('83 NES) ●Mega Man ('87 NES) ●Wolfenstein 3D ('92 PC) ●Homeworld ('99 PC) ●Legend Of Zelda ('86 NES) ●Mortal Kombat ('92) ●Doom/Quake ('93 PC) ●Contra/Castlevania ('86 NES) ● Hitchhiker's GTTG ('84 TRS-80) ●Zenophobe ('87 Arcade) ●Battlezone ('80 Arcade)