SlideShare a Scribd company logo
Journey to Docker
Production
Bret Fisher
Independent DevOps Sysadmin
Docker Captain
• Docker Dev+Ops user since 2014
• Used for my co-founded startup
• Now, fill time container ops indi
consultant
• Helped over dozen orgs go prod
Who Am I?
• You want Docker in production
• Containerizing existing infrastructure/apps
• Need to break down barriers of getting into Docker production
• Often these are "decision barriers", lets make some good defaults
• Sometimes it's made-up requirements that aren't required day one
• Hopefully I will help you today with all of these!
Why Are We Here?
• Containerize As-Is
• What To Focus On First
• Building Prod Layer by Layer
• Agile Infrastructure Planning
• Other Ways To Make An Impact
Agenda
Production Docker: A New Hope
"Containerize as-is!"
New to containers? Limit other changes
Sounds obvious, but many container projects start out too big in scope
Problems you likely don't need to solve before container day one
• Fully automatic CI/CD
• Dynamic performance scaling
• Containerizing all of an existing solution at once
• Service discovery (dynamic updates to LB's, DNS, etc.)
• Starting with persistent data
Limit Your Simultaneous Innovation
• Microservice conversion isn't required
• 12 Factor is a horizon we're always chasing
• Don't let these ideals delay containerization
• Maybe we need a 12 Factor 12-step program
Legacy Apps Work In Containers Too
At its core, a container is just a process
You need a good foundation
What To Focus
On First
is the path to the dark side
A Bad Dockerfile...
Good Dockerfiles are more important than fancy orchestration
• It's your new build and environment documentation
• At first, focus on "it works" rather then fancy or lean (or multi-stage)
• Use FROM Official distros that are most familiar
What To Focus On First: Dockerfiles
Dockerfile Production Anti-patterns
New teams often have anti-patterns or wrong defaults
Lets look at some of these shall we:
• Anti: Not storing unique data in volumes
Dockerfile Anti-pattern: Trapping Data
👍😺
• Not to be confused with Bind Mounts for sharing data with host
• Anti: Letting image builds pull FROM latest
Dockerfile Anti-pattern: No Version Pinning
👍😻
• Anti: Letting image builds install latest packages
• You don't do this with your code, why do it with dependencies?
• Anti: Not changing defaults in container like you would on a VM
• e.g. php.ini, mysql.conf.d, java memory
Dockerfile Anti-pattern: Leaving Default Config
👍😽
• NOTE: Don't just copy over config files from VM's into image
• Anti: Copying in environment config at image build
Dockerfile Anti-pattern: Environment Specific
👎🙀
• Goal: Single Dockerfile with default ENV's, and overwrite per-
environment at run time
Building Prod Layer by Layer
• Stick with what you know at first
• Do some basic performance testing of your existing and
planned setup. Even if just defaults with sample data. You will
learn lots!
• Recent Docker Inc. and HPE whitepaper on MySQL benchmark
• (authored by yours truly, and others)
• bretfisher.com/dockercon17
Containers-on-VM or Container-on-Bare-Metal
Do either, or both. Lots of pros/cons to either
• Docker is kernel and storage driver dependent
• Innovations/fixes are still happening here
• "Minimum" version != "best" version
• No pre-existing opinion? Ubuntu 16.04.2 LTS (latest LTS)
• Popular, well-tested with Docker
• One of latest LTS kernels out there
• Wide storage driver support
• Get correct Docker for your distro from store.docker.com
Linux Distribution/Release Matters
• Don't make a decision based on image size (remember it's SIS)
• At first: match your existing deployment process
• Consider changing to Alpine later, maybe much later
Container Base Distribution: Which One?
Swarm Architectures
• General advice on how to start small and grow big
• Based off learnings from
• Docker internal testing
• Docker reference architectures
• Real world deployments
• Swarm3k lessons learned
Good Defaults: Swarm Architectures
• "docker swarm init" done!
• This happens every day with VM's, why
not with containers
• Why bother with swarm? Keeping
same workflow across environments,
secrets, etc.
1-Node Swarm
Baby Swarm
• All Managers and Workers
• One node can fail
• Great when on a very small budget
• pet projects
• test/CI setups
3-Node Swarm
Minimum for HA
• All Managers and Workers
• Two nodes can fail
• My minimum for production that
affects business $$
5-Node Swarm
Better High-Availability
• 5 dedicated managers
• Maybe some workers in DMZ
• Anything beyond 5 nodes, stick
with 5 Managers and rest workers
• Control container placement with
labels + constraints
10-Node Swarm
Separating Out Managers
> docker node update --label-add data-drive=ssd worker1
> docker node update --label-add net-segment=dmz1 worker2
Constraints with Swarm Services
> docker service create 
--constraint node.labels.data-drive==ssd mysql
• 5 dedicated managers
• Resize managers as you grow
• Multiple worker subnets on
Private/DMZ
• Control container placement with
labels + constraints
100-Node Swarm
Aww she's all grown up!
• Different hardware configurations
• Different subnets or security groups
• Solution: Use node labels with container constraints
Not-So-Good Reasons for Multiple Swarms
• Geographical boundaries between nodes (e.g. different regions)
• Security boundaries for compliance (PCI, etc.)
• Personnel boundaries for Swarm management using Docker API
• (could mitigate Docker EE UCP, auth plugin)
Good Reasons for Multiple Swarms
Do You Have An Externally
Driven Deadline?
• Beware the "Not Implemented Here" Syndrome
• Similar to "not invented here"
• Opportunities for Outsourcing
• Where it can still be a challenge to implement and maintain
• And, where the SaaS/On-prem market is mature
• For Your Consideration
• Image registry
• Log aggregation, storage, search, and alerting
• 17.05 gets service logs, good for getting started
• Monitoring and alerting
Outsource Well-Defined Plumbing
Other Docker Products that Compliment
Docker	CE
• Swarm/Stacks/Secrets/Routing	Mesh
• CLI	Management
Docker	for	
AWS/Azure
• Cloud	Resource	Template
• Moby	Instance	OS
Docker	EE
• DTR/UCP
• GUI	Mgmt/RBAC/Layer	7	Proxy/Image	Cache
More	Effort
More	Decisions
Less	Effort
Less	Decisions
Remember To Be Agile,
You'll Build The Next One Better
• Already have good infrastructure automation (one click VM)?
• Maybe you have great VM autoscale with single-service VM's?
• Like the security boundary of the VM OS?
You Want Even Less Ops Change?
Lets accelerate this even more
• Least amount of infrastructure change while letting you:
• Run on Dockerfiles recipes rather then Puppet etc.
• Improve your Docker management skills
• Simplify your VM OS build
• Moby Project & LinuxKit will likely make this more popular
• Windows is doing similar with Hyper-V Containers
• Linux is doing similar with Intel Clear Containers
One Container Per VM
Why don't we talk about this more?
Other Ways To Make An Impact
• Use containers for tech support mock environments
• Temp test environments, customer demos
• Any process where you "wait for human to deploy/configure VM"
Other Ways To Make An Impact
Docker can be used internally and still add value
Thank You!
My New Docker Udemy Course
90% off for DockerCon:
dockermastery.com
slides:
bretfisher.com/dockercon17

More Related Content

PDF
You Don't Have to Start Over! A Practical Guide for Adopting Docker in the En...
Docker, Inc.
 
PDF
Building a Secure App with Docker - Ying Li and David Lawrence, Docker
Docker, Inc.
 
PDF
Back to the Future: Containerize Legacy Applications - Rob Tanner, Northern T...
Docker, Inc.
 
PDF
Securing the Container Pipeline at Salesforce by Cem Gurkok
Docker, Inc.
 
PDF
The Tale of Two Deployments: Greenfield and Monolith Apps with Docker Enterpr...
Docker, Inc.
 
PDF
Docker Networking in Production at Visa - Sasi Kannappan, Visa and Mark Churc...
Docker, Inc.
 
PDF
Docker for .NET Developers - Michele Leroux Bustamante, Solliance
Docker, Inc.
 
PDF
Containerize All the (Multi-Platform) Things! by Phil Estes
Docker, Inc.
 
You Don't Have to Start Over! A Practical Guide for Adopting Docker in the En...
Docker, Inc.
 
Building a Secure App with Docker - Ying Li and David Lawrence, Docker
Docker, Inc.
 
Back to the Future: Containerize Legacy Applications - Rob Tanner, Northern T...
Docker, Inc.
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Docker, Inc.
 
The Tale of Two Deployments: Greenfield and Monolith Apps with Docker Enterpr...
Docker, Inc.
 
Docker Networking in Production at Visa - Sasi Kannappan, Visa and Mark Churc...
Docker, Inc.
 
Docker for .NET Developers - Michele Leroux Bustamante, Solliance
Docker, Inc.
 
Containerize All the (Multi-Platform) Things! by Phil Estes
Docker, Inc.
 

What's hot (20)

PPTX
How to be successful running Docker in Production
Docker, Inc.
 
PDF
Escape From Your VMs with Image2Docker Jeff Nickoloff, All in Geek Consulting...
Docker, Inc.
 
PDF
Global Operations with Docker for the Enterprise - Nico Kabar, Docker
Docker, Inc.
 
PDF
DCSF19 CMD and Conquer: Containerizing the Monolith
Docker, Inc.
 
PDF
Automated hardware testing using docker for space
Docker, Inc.
 
PDF
DCSF19 Container Security: Theory & Practice at Netflix
Docker, Inc.
 
PDF
Taking Docker from Local to Production at Intuit JanJaap Lahpor, Intuit and H...
Docker, Inc.
 
PPTX
Experiences with AWS immutable deploys and job processing
Docker, Inc.
 
PDF
Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...
Docker, Inc.
 
PDF
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
PDF
What’s New in Docker - Victor Vieux, Docker
Docker, Inc.
 
PDF
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
Docker, Inc.
 
PDF
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
Docker, Inc.
 
ODP
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Docker, Inc.
 
PPTX
Docker Container Lifecycles, Problem or Opportunity? by Baruch Sadogursky, JFrog
Docker, Inc.
 
PDF
Intro to docker - innovation demo 2022
Hussain Mansoor
 
PDF
DockerCon EU 2015: Monitoring Docker
Docker, Inc.
 
PPTX
DockerCon EU 2015: Cultural Revolution - How to Mange the Change Docker Brings
Docker, Inc.
 
PDF
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
Docker, Inc.
 
PDF
Mobycraft - Docker in 8-bit by Aditya Gupta
Docker, Inc.
 
How to be successful running Docker in Production
Docker, Inc.
 
Escape From Your VMs with Image2Docker Jeff Nickoloff, All in Geek Consulting...
Docker, Inc.
 
Global Operations with Docker for the Enterprise - Nico Kabar, Docker
Docker, Inc.
 
DCSF19 CMD and Conquer: Containerizing the Monolith
Docker, Inc.
 
Automated hardware testing using docker for space
Docker, Inc.
 
DCSF19 Container Security: Theory & Practice at Netflix
Docker, Inc.
 
Taking Docker from Local to Production at Intuit JanJaap Lahpor, Intuit and H...
Docker, Inc.
 
Experiences with AWS immutable deploys and job processing
Docker, Inc.
 
Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...
Docker, Inc.
 
DockerCon 2017 - Cilium - Network and Application Security with BPF and XDP
Thomas Graf
 
What’s New in Docker - Victor Vieux, Docker
Docker, Inc.
 
Sharding Containers: Make Go Apps Computer-Friendly Again by Andrey Sibiryov
Docker, Inc.
 
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
Docker, Inc.
 
Practical Container Security by Mrunal Patel and Thomas Cameron, Red Hat
Docker, Inc.
 
Docker Container Lifecycles, Problem or Opportunity? by Baruch Sadogursky, JFrog
Docker, Inc.
 
Intro to docker - innovation demo 2022
Hussain Mansoor
 
DockerCon EU 2015: Monitoring Docker
Docker, Inc.
 
DockerCon EU 2015: Cultural Revolution - How to Mange the Change Docker Brings
Docker, Inc.
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
Docker, Inc.
 
Mobycraft - Docker in 8-bit by Aditya Gupta
Docker, Inc.
 
Ad

Similar to Journey to Docker Production: Evolving Your Infrastructure and Processes - Bret Fisher, Independent Docker Consultant (20)

PDF
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
PDF
Taking Docker to Production: What You Need to Know and Decide
Bret Fisher
 
PDF
Going Production with Docker and Swarm
C4Media
 
PDF
Perspectives on Docker
RightScale
 
PDF
codemotion-docker-2014
Carlo Bonamico
 
PDF
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Codemotion
 
PDF
Docker: do's and don'ts
Paolo Tonin
 
PDF
Docker-v3.pdf
Bruno Cornec
 
PDF
JOSA TechTalk: Taking Docker to Production
Jordan Open Source Association
 
PDF
Techtalks: taking docker to production
muayyad alsadi
 
PDF
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
PDF
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
ODP
Docker and stuff
Raimondas Rimkevičius
 
PDF
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
PDF
Introduction to Docker and Monitoring with InfluxData
InfluxData
 
PDF
DCSF19 Containers for Beginners
Docker, Inc.
 
PDF
Dockerize your Symfony application - Symfony Live NYC 2014
André Rømcke
 
PDF
Introduction to Docker - Vellore Institute of Technology
Ajeet Singh Raina
 
PDF
Introduction to Containers
Dharmit Shah
 
PDF
DockerPenang Meetup#1
Sujay Pillai
 
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
Taking Docker to Production: What You Need to Know and Decide
Bret Fisher
 
Going Production with Docker and Swarm
C4Media
 
Perspectives on Docker
RightScale
 
codemotion-docker-2014
Carlo Bonamico
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Codemotion
 
Docker: do's and don'ts
Paolo Tonin
 
Docker-v3.pdf
Bruno Cornec
 
JOSA TechTalk: Taking Docker to Production
Jordan Open Source Association
 
Techtalks: taking docker to production
muayyad alsadi
 
Docker Essentials Workshop— Innovation Labs July 2020
CloudHero
 
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
Docker and stuff
Raimondas Rimkevičius
 
Best Practices for Developing & Deploying Java Applications with Docker
Eric Smalling
 
Introduction to Docker and Monitoring with InfluxData
InfluxData
 
DCSF19 Containers for Beginners
Docker, Inc.
 
Dockerize your Symfony application - Symfony Live NYC 2014
André Rømcke
 
Introduction to Docker - Vellore Institute of Technology
Ajeet Singh Raina
 
Introduction to Containers
Dharmit Shah
 
DockerPenang Meetup#1
Sujay Pillai
 
Ad

More from Docker, Inc. (20)

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

Recently uploaded (20)

PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
The Future of Artificial Intelligence (AI)
Mukul
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Doc9.....................................
SofiaCollazos
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 

Journey to Docker Production: Evolving Your Infrastructure and Processes - Bret Fisher, Independent Docker Consultant

  • 1. Journey to Docker Production Bret Fisher Independent DevOps Sysadmin Docker Captain
  • 2. • Docker Dev+Ops user since 2014 • Used for my co-founded startup • Now, fill time container ops indi consultant • Helped over dozen orgs go prod Who Am I?
  • 3. • You want Docker in production • Containerizing existing infrastructure/apps • Need to break down barriers of getting into Docker production • Often these are "decision barriers", lets make some good defaults • Sometimes it's made-up requirements that aren't required day one • Hopefully I will help you today with all of these! Why Are We Here?
  • 4. • Containerize As-Is • What To Focus On First • Building Prod Layer by Layer • Agile Infrastructure Planning • Other Ways To Make An Impact Agenda
  • 5. Production Docker: A New Hope "Containerize as-is!"
  • 6. New to containers? Limit other changes Sounds obvious, but many container projects start out too big in scope Problems you likely don't need to solve before container day one • Fully automatic CI/CD • Dynamic performance scaling • Containerizing all of an existing solution at once • Service discovery (dynamic updates to LB's, DNS, etc.) • Starting with persistent data Limit Your Simultaneous Innovation
  • 7. • Microservice conversion isn't required • 12 Factor is a horizon we're always chasing • Don't let these ideals delay containerization • Maybe we need a 12 Factor 12-step program Legacy Apps Work In Containers Too At its core, a container is just a process
  • 8. You need a good foundation What To Focus On First
  • 9. is the path to the dark side A Bad Dockerfile...
  • 10. Good Dockerfiles are more important than fancy orchestration • It's your new build and environment documentation • At first, focus on "it works" rather then fancy or lean (or multi-stage) • Use FROM Official distros that are most familiar What To Focus On First: Dockerfiles
  • 11. Dockerfile Production Anti-patterns New teams often have anti-patterns or wrong defaults Lets look at some of these shall we:
  • 12. • Anti: Not storing unique data in volumes Dockerfile Anti-pattern: Trapping Data 👍😺 • Not to be confused with Bind Mounts for sharing data with host
  • 13. • Anti: Letting image builds pull FROM latest Dockerfile Anti-pattern: No Version Pinning 👍😻 • Anti: Letting image builds install latest packages • You don't do this with your code, why do it with dependencies?
  • 14. • Anti: Not changing defaults in container like you would on a VM • e.g. php.ini, mysql.conf.d, java memory Dockerfile Anti-pattern: Leaving Default Config 👍😽 • NOTE: Don't just copy over config files from VM's into image
  • 15. • Anti: Copying in environment config at image build Dockerfile Anti-pattern: Environment Specific 👎🙀 • Goal: Single Dockerfile with default ENV's, and overwrite per- environment at run time
  • 17. • Stick with what you know at first • Do some basic performance testing of your existing and planned setup. Even if just defaults with sample data. You will learn lots! • Recent Docker Inc. and HPE whitepaper on MySQL benchmark • (authored by yours truly, and others) • bretfisher.com/dockercon17 Containers-on-VM or Container-on-Bare-Metal Do either, or both. Lots of pros/cons to either
  • 18. • Docker is kernel and storage driver dependent • Innovations/fixes are still happening here • "Minimum" version != "best" version • No pre-existing opinion? Ubuntu 16.04.2 LTS (latest LTS) • Popular, well-tested with Docker • One of latest LTS kernels out there • Wide storage driver support • Get correct Docker for your distro from store.docker.com Linux Distribution/Release Matters
  • 19. • Don't make a decision based on image size (remember it's SIS) • At first: match your existing deployment process • Consider changing to Alpine later, maybe much later Container Base Distribution: Which One?
  • 21. • General advice on how to start small and grow big • Based off learnings from • Docker internal testing • Docker reference architectures • Real world deployments • Swarm3k lessons learned Good Defaults: Swarm Architectures
  • 22. • "docker swarm init" done! • This happens every day with VM's, why not with containers • Why bother with swarm? Keeping same workflow across environments, secrets, etc. 1-Node Swarm Baby Swarm
  • 23. • All Managers and Workers • One node can fail • Great when on a very small budget • pet projects • test/CI setups 3-Node Swarm Minimum for HA
  • 24. • All Managers and Workers • Two nodes can fail • My minimum for production that affects business $$ 5-Node Swarm Better High-Availability
  • 25. • 5 dedicated managers • Maybe some workers in DMZ • Anything beyond 5 nodes, stick with 5 Managers and rest workers • Control container placement with labels + constraints 10-Node Swarm Separating Out Managers
  • 26. > docker node update --label-add data-drive=ssd worker1 > docker node update --label-add net-segment=dmz1 worker2 Constraints with Swarm Services > docker service create --constraint node.labels.data-drive==ssd mysql
  • 27. • 5 dedicated managers • Resize managers as you grow • Multiple worker subnets on Private/DMZ • Control container placement with labels + constraints 100-Node Swarm Aww she's all grown up!
  • 28. • Different hardware configurations • Different subnets or security groups • Solution: Use node labels with container constraints Not-So-Good Reasons for Multiple Swarms
  • 29. • Geographical boundaries between nodes (e.g. different regions) • Security boundaries for compliance (PCI, etc.) • Personnel boundaries for Swarm management using Docker API • (could mitigate Docker EE UCP, auth plugin) Good Reasons for Multiple Swarms
  • 30. Do You Have An Externally Driven Deadline?
  • 31. • Beware the "Not Implemented Here" Syndrome • Similar to "not invented here" • Opportunities for Outsourcing • Where it can still be a challenge to implement and maintain • And, where the SaaS/On-prem market is mature • For Your Consideration • Image registry • Log aggregation, storage, search, and alerting • 17.05 gets service logs, good for getting started • Monitoring and alerting Outsource Well-Defined Plumbing
  • 32. Other Docker Products that Compliment Docker CE • Swarm/Stacks/Secrets/Routing Mesh • CLI Management Docker for AWS/Azure • Cloud Resource Template • Moby Instance OS Docker EE • DTR/UCP • GUI Mgmt/RBAC/Layer 7 Proxy/Image Cache More Effort More Decisions Less Effort Less Decisions
  • 33. Remember To Be Agile, You'll Build The Next One Better
  • 34. • Already have good infrastructure automation (one click VM)? • Maybe you have great VM autoscale with single-service VM's? • Like the security boundary of the VM OS? You Want Even Less Ops Change? Lets accelerate this even more
  • 35. • Least amount of infrastructure change while letting you: • Run on Dockerfiles recipes rather then Puppet etc. • Improve your Docker management skills • Simplify your VM OS build • Moby Project & LinuxKit will likely make this more popular • Windows is doing similar with Hyper-V Containers • Linux is doing similar with Intel Clear Containers One Container Per VM Why don't we talk about this more?
  • 36. Other Ways To Make An Impact
  • 37. • Use containers for tech support mock environments • Temp test environments, customer demos • Any process where you "wait for human to deploy/configure VM" Other Ways To Make An Impact Docker can be used internally and still add value
  • 38. Thank You! My New Docker Udemy Course 90% off for DockerCon: dockermastery.com slides: bretfisher.com/dockercon17