SlideShare a Scribd company logo
1 of 25
Download to read offline
Docker 102 
Immutable Infrastructure 
Presented by: Adrian Otto 
Prepared for: Docker Los Angeles 
Date: September 10, 2014
Adrian Otto 
• Principal Architect, Rackspace 
• PTL, Solum 
• Chair, OpenStack Containers Team 
• Co-Chair, OASIS CAMP Technical Committee 
2
3 
Quick Review of Docker 101
4 
Docker 101 Slides 
http://www.slideshare.net/adrianjotto/docker-101-38986794 
Please view slides above for my overview of Docker
5 
Immutable Infrastructure
Immutable 
[ih-myoo-tuh-buh l] 
adjective 
1. Not mutable; unchangeable; changeless. 
Origin: 
1375-1425; late Middle English < Latin immūtābilis. 
6
Immutable 
I - Mute - The - Bull 
7
What is Immutable Infrastructure? 
• Utopia 
– Applications are deployed, and code is never modified. 
– Configuration is never modified (in place) 
– Patches are never applied 
– Only administrative actions are “deploy” and “destroy”. 
8
Who Cares? 
• Rationale 
– Full Automation Means Consistency 
– Re-Deploy More Often 
– SHIP IT 
– $$$ 
9
How? 
• Any time you want to do a change to your app, redeploy. 
• Any time you want to change your data schema, migration script. 
10
11 
Techniques
Feature Flags 
• Assumes you control the code in the application 
• Wrap new features in conditions 
• Activate conditions in accordance with appropriate risk 
– By group 
– By user settings 
– By percentage of users 
• De-Activate as needed (no re-deploy needed!) 
12
Containerization with Docker 
• Source repository contains a Dockerfile 
• Build process produces a container 
• Inject configuration using ENV key/pair values 
• Use same container for test, stage, and prod 
13
Limiting Downtime 
• Green/Blue Deploy 
1. Create live replica of database 
2. Duplicate all application nodes with new code/config 
3. Adjust routing (load balancer) to activate new code 
14 
App v1.0 
App v1.0 
App v1.1 
App v1.1 
Db v1.0 
Db v1.1 
LB
Limiting Risk 
• Canary Deploy 
1. Requires Feature Flags or Sticky LB Sessions 
2. Back up your data 
3. All nodes use the production database 
4. Route new connections to new node(s) 
15 
App v1.0 
LB App v1.0 
Db v1.0 
App v1.1
When to Use Canary 
• No contract breaking changes to your data schema 
– Or, you have an object versioned database 
• You use feature flags 
• Impractical to test the feature outside production 
• Have a full backup of your data, and can restore 
16
When to Use Blue/Green 
• You are updating your data schema 
• You don’t have an object versioned database 
• You don’t have feature flags 
• Can test the feature outside production 
• Restoring from a backup is not practical (big data sets) 
– Plan for the worst case scenario: Oops, my feature blew up! 
17
18 
Orchestration
Imperative and Declarative 
Imperative 
– Define the process 
– Sequenced steps 
– Usually serialized 
– Expressed as a script 
Examples 
– Shell scripts 
– Puppet scripts 
– Chef recipes 
Declarative 
– Define the outcome 
– Ordering possible 
– Good for parallel work 
– Expressed as a DSL 
Examples 
– Fig 
– Heat 
– Solum 
19
Tools to Help 
• Solum and OpenStack 
– Heat (HOT Files) 
• Jenkins 
• Ansible 
• SaltStack 
• Chef 
20
Immutable Infrastructure with Docker 
• Docker Public Registry 
• Private Registry 
– Run as a container (There be Dragons!) 
– Run with Glance Backend (OpenStack) 
– Run with Swift Backend (OpenStack) 
– Run with S3 Backend (AWS) 
• Docker Private Repos 
– Example: adrianotto/private 
– Not visible in the public registry 
– Only you can push/pull to/from the repo 
– 1 Private Repo is free 
– 5 private repos free for 2 months with promo code: docker-los-angeles 
– Allows for webhook integration 
– Can be shared with other users 
– Can be tagged 
21
22 
https://hub.docker.com
Using a Private Repo 
[root@example~]# docker login! 
Username: h4x0r4u! 
Password: ! 
Email: example@example.com! 
[root@example~]# docker pull centos:centos6! 
[root@example~]# docker run -i -t centos:centos6 /bin/bash! 
bash-4.1# echo hello > hello.txt! 
bash-4.1# exit! 
[root@example~]# docker ps –a! 
CONTAINER ID IMAGE COMMAND CREATED STATUS…! 
f7485ea35f26 centos:centos6 /bin/bash 4 minutes ago Exited (0) 2…! 
[root@example~]# docker commit f7485ea35f26 h4x0r4u/private! 
1898aef1c36014b3702c3532263a9064ba928b78a9b2ccf44a101c61028179cd! 
[root@example~]# docker images! 
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE! 
h4x0r4u/private latest 1898aef1c360 3 seconds ago 212.7 MB! 
centos centos6 68eb857ffb51 1 day ago 212.7 MB! 
23 
Note: Private 
repos can only 
be seen by you
Updating Base Images 
[root@example~]# docker images! 
REPOSITORY TAG IMAGE ID CREATED VIRTUAL 
SIZE! 
centos centos6 b1bd49907d55 5 weeks ago 212.5 MB! 
centos centos7 b157b77b1a65 5 weeks ago 243.7 MB! 
centos latest b157b77b1a65 5 weeks ago 243.7 MB! 
[root@example~]# docker pull centos:centos6! 
68eb857ffb51: Download complete ! 
511136ea3c5a: Download complete ! 
34e94e67e63a: Download complete ! 
[root@example~]# docker images! 
REPOSITORY TAG IMAGE ID CREATED VIRTUAL 
SIZE! 
centos centos6 68eb857ffb51 1 day ago 212.7 MB! 
centos centos7 b157b77b1a65 5 weeks ago 243.7 MB! 
centos latest b157b77b1a65 5 weeks ago 243.7 MB! 
24 
Hint: Automate 
for evergreen 
environment
25

More Related Content

What's hot

Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCPhil Estes
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basicsWalid Ashraf
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux KernelDocker, Inc.
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Henryk Konsek
 
runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...Docker, Inc.
 
dockerizing web application
dockerizing web applicationdockerizing web application
dockerizing web applicationWalid Ashraf
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerKuan Yen Heng
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleDmytro Slupytskyi
 
Containerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container RuntimeContainerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container RuntimePhil Estes
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!Adrian Otto
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker securityWalid Ashraf
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsThomas Chacko
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneD
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerizationBalint Pato
 
Magnum first-class-resource
Magnum first-class-resourceMagnum first-class-resource
Magnum first-class-resourceAdrian Otto
 

What's hot (20)

Docker Workshop
Docker WorkshopDocker Workshop
Docker Workshop
 
Devoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runCDevoxx 2016: A Developer's Guide to OCI and runC
Devoxx 2016: A Developer's Guide to OCI and runC
 
docker installation and basics
docker installation and basicsdocker installation and basics
docker installation and basics
 
Docker and the Linux Kernel
Docker and the Linux KernelDocker and the Linux Kernel
Docker and the Linux Kernel
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 
runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...
 
dockerizing web application
dockerizing web applicationdockerizing web application
dockerizing web application
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Ansible docker
Ansible dockerAnsible docker
Ansible docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
 
Containerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container RuntimeContainerd Internals: Building a Core Container Runtime
Containerd Internals: Building a Core Container Runtime
 
Using Docker with OpenStack - Hands On!
 Using Docker with OpenStack - Hands On! Using Docker with OpenStack - Hands On!
Using Docker with OpenStack - Hands On!
 
Introduction to docker security
Introduction to docker securityIntroduction to docker security
Introduction to docker security
 
Intro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and WindowsIntro- Docker Native for OSX and Windows
Intro- Docker Native for OSX and Windows
 
Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
Magnum first-class-resource
Magnum first-class-resourceMagnum first-class-resource
Magnum first-class-resource
 

Similar to Docker 102 - Immutable Infrastructure

Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014Rafe Colton
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Jérôme Petazzoni
 
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 YorkJérôme Petazzoni
 
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 AngelesJérôme Petazzoni
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoHannes Hapke
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsElasTest Project
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...Eric Smalling
 
Docking postgres
Docking postgresDocking postgres
Docking postgresrycamor
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWSAndrew Heifetz
 
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 RightScale
 
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 CountyJérôme Petazzoni
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniTheFamily
 

Similar to Docker 102 - Immutable Infrastructure (20)

Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
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
 
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
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
 
Docking postgres
Docking postgresDocking postgres
Docking postgres
 
Continuous Integration with Docker on AWS
Continuous Integration with Docker on AWSContinuous Integration with Docker on AWS
Continuous Integration with Docker on AWS
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
 
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 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
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 

More from Adrian Otto

What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?Adrian Otto
 
Build Your Own Open Source Cloud
Build Your Own Open Source CloudBuild Your Own Open Source Cloud
Build Your Own Open Source CloudAdrian Otto
 
OpenStack Magnum 2016-08-04
OpenStack Magnum 2016-08-04OpenStack Magnum 2016-08-04
OpenStack Magnum 2016-08-04Adrian Otto
 
OpenStack Magnum
OpenStack MagnumOpenStack Magnum
OpenStack MagnumAdrian Otto
 
7 Habits of Highly Effective Contirbutors
7 Habits of Highly Effective Contirbutors7 Habits of Highly Effective Contirbutors
7 Habits of Highly Effective ContirbutorsAdrian Otto
 
Docker for Multi-Cloud Apps
Docker for Multi-Cloud AppsDocker for Multi-Cloud Apps
Docker for Multi-Cloud AppsAdrian Otto
 

More from Adrian Otto (6)

What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?What's really the difference between a VM and a Container?
What's really the difference between a VM and a Container?
 
Build Your Own Open Source Cloud
Build Your Own Open Source CloudBuild Your Own Open Source Cloud
Build Your Own Open Source Cloud
 
OpenStack Magnum 2016-08-04
OpenStack Magnum 2016-08-04OpenStack Magnum 2016-08-04
OpenStack Magnum 2016-08-04
 
OpenStack Magnum
OpenStack MagnumOpenStack Magnum
OpenStack Magnum
 
7 Habits of Highly Effective Contirbutors
7 Habits of Highly Effective Contirbutors7 Habits of Highly Effective Contirbutors
7 Habits of Highly Effective Contirbutors
 
Docker for Multi-Cloud Apps
Docker for Multi-Cloud AppsDocker for Multi-Cloud Apps
Docker for Multi-Cloud Apps
 

Recently uploaded

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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 SavingEdi Saputra
 
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...apidays
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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 Takeoffsammart93
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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)wesley chun
 
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 businesspanagenda
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
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 RobisonAnna Loughnan Colquhoun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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 CVKhem
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 DevelopmentsTrustArc
 
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 WorkerThousandEyes
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
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
 

Docker 102 - Immutable Infrastructure

  • 1. Docker 102 Immutable Infrastructure Presented by: Adrian Otto Prepared for: Docker Los Angeles Date: September 10, 2014
  • 2. Adrian Otto • Principal Architect, Rackspace • PTL, Solum • Chair, OpenStack Containers Team • Co-Chair, OASIS CAMP Technical Committee 2
  • 3. 3 Quick Review of Docker 101
  • 4. 4 Docker 101 Slides http://www.slideshare.net/adrianjotto/docker-101-38986794 Please view slides above for my overview of Docker
  • 6. Immutable [ih-myoo-tuh-buh l] adjective 1. Not mutable; unchangeable; changeless. Origin: 1375-1425; late Middle English < Latin immūtābilis. 6
  • 7. Immutable I - Mute - The - Bull 7
  • 8. What is Immutable Infrastructure? • Utopia – Applications are deployed, and code is never modified. – Configuration is never modified (in place) – Patches are never applied – Only administrative actions are “deploy” and “destroy”. 8
  • 9. Who Cares? • Rationale – Full Automation Means Consistency – Re-Deploy More Often – SHIP IT – $$$ 9
  • 10. How? • Any time you want to do a change to your app, redeploy. • Any time you want to change your data schema, migration script. 10
  • 12. Feature Flags • Assumes you control the code in the application • Wrap new features in conditions • Activate conditions in accordance with appropriate risk – By group – By user settings – By percentage of users • De-Activate as needed (no re-deploy needed!) 12
  • 13. Containerization with Docker • Source repository contains a Dockerfile • Build process produces a container • Inject configuration using ENV key/pair values • Use same container for test, stage, and prod 13
  • 14. Limiting Downtime • Green/Blue Deploy 1. Create live replica of database 2. Duplicate all application nodes with new code/config 3. Adjust routing (load balancer) to activate new code 14 App v1.0 App v1.0 App v1.1 App v1.1 Db v1.0 Db v1.1 LB
  • 15. Limiting Risk • Canary Deploy 1. Requires Feature Flags or Sticky LB Sessions 2. Back up your data 3. All nodes use the production database 4. Route new connections to new node(s) 15 App v1.0 LB App v1.0 Db v1.0 App v1.1
  • 16. When to Use Canary • No contract breaking changes to your data schema – Or, you have an object versioned database • You use feature flags • Impractical to test the feature outside production • Have a full backup of your data, and can restore 16
  • 17. When to Use Blue/Green • You are updating your data schema • You don’t have an object versioned database • You don’t have feature flags • Can test the feature outside production • Restoring from a backup is not practical (big data sets) – Plan for the worst case scenario: Oops, my feature blew up! 17
  • 19. Imperative and Declarative Imperative – Define the process – Sequenced steps – Usually serialized – Expressed as a script Examples – Shell scripts – Puppet scripts – Chef recipes Declarative – Define the outcome – Ordering possible – Good for parallel work – Expressed as a DSL Examples – Fig – Heat – Solum 19
  • 20. Tools to Help • Solum and OpenStack – Heat (HOT Files) • Jenkins • Ansible • SaltStack • Chef 20
  • 21. Immutable Infrastructure with Docker • Docker Public Registry • Private Registry – Run as a container (There be Dragons!) – Run with Glance Backend (OpenStack) – Run with Swift Backend (OpenStack) – Run with S3 Backend (AWS) • Docker Private Repos – Example: adrianotto/private – Not visible in the public registry – Only you can push/pull to/from the repo – 1 Private Repo is free – 5 private repos free for 2 months with promo code: docker-los-angeles – Allows for webhook integration – Can be shared with other users – Can be tagged 21
  • 23. Using a Private Repo [root@example~]# docker login! Username: h4x0r4u! Password: ! Email: example@example.com! [root@example~]# docker pull centos:centos6! [root@example~]# docker run -i -t centos:centos6 /bin/bash! bash-4.1# echo hello > hello.txt! bash-4.1# exit! [root@example~]# docker ps –a! CONTAINER ID IMAGE COMMAND CREATED STATUS…! f7485ea35f26 centos:centos6 /bin/bash 4 minutes ago Exited (0) 2…! [root@example~]# docker commit f7485ea35f26 h4x0r4u/private! 1898aef1c36014b3702c3532263a9064ba928b78a9b2ccf44a101c61028179cd! [root@example~]# docker images! REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE! h4x0r4u/private latest 1898aef1c360 3 seconds ago 212.7 MB! centos centos6 68eb857ffb51 1 day ago 212.7 MB! 23 Note: Private repos can only be seen by you
  • 24. Updating Base Images [root@example~]# docker images! REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE! centos centos6 b1bd49907d55 5 weeks ago 212.5 MB! centos centos7 b157b77b1a65 5 weeks ago 243.7 MB! centos latest b157b77b1a65 5 weeks ago 243.7 MB! [root@example~]# docker pull centos:centos6! 68eb857ffb51: Download complete ! 511136ea3c5a: Download complete ! 34e94e67e63a: Download complete ! [root@example~]# docker images! REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE! centos centos6 68eb857ffb51 1 day ago 212.7 MB! centos centos7 b157b77b1a65 5 weeks ago 243.7 MB! centos latest b157b77b1a65 5 weeks ago 243.7 MB! 24 Hint: Automate for evergreen environment
  • 25. 25