SlideShare a Scribd company logo
@muktaa
Baking Docker using Chef
Mukta Aphale
Agile India Conf 2016, Bangalore
+
@muktaa
Who am I?
• C, Ruby, Java developer turned into DevOps Architect
• Contributed to Chef development
• Chef azure extension
• Knife plugins: knife-azure, knife-ec2, knife-openstack
• Knife WinRM, knife windows listener
• Worked extensively with Docker
• Docker authorized consultant
• Technology, innovation and the thirst to keep learning are what
define me
• Love to travel, read, write
• Above all, I am a mother to two boys!
@muktaa
Agenda
•The Chef Journey
•Container Era
•Chef + Docker
•Example
•Docker cookbook
•Example
@muktaa
The Chef Journey
@muktaa
Chef Journey
• Adam Jacob, Jessie Robbins, Barry Steinglass, Nathan Haneysmith,
Joshua Timberman
• Marionette
• Opscode
• First release: Jan 2009
• Ruby, Erlang
• Facebook, Nordstorm, Disney, GE
• Configuration Management
• Cloud Management
• Chef Delivery
@muktaa
Container Era
@muktaa
Evolution
• 2000: Jails, FreeBSD
• 2001: Linux-Vserver
• 2006: cgroups
• 2008: LXC Containers
• 2013: Docker
• June 2014: Docker 1.0
• Today: Docker 1.10.3
@muktaa
Docker
• Learning curve
• No need for huge investment at the early stage
• “I wont use Chef for that small deployment”
• “Now I have 100 servers. Makes sense to use Chef”
• “Now I have 100 containers. How do I manage them?”
@muktaa
Docker
A Quick Introduction
@muktaa
What is Docker?
Linux	
  Container
3	
  Components:
Docker Engine
Docker Hub
Docker Images
Benefits:
Speed
Portability
Density
Open	
  Source
“Can	
  create	
  lightweight,	
  self	
  
sufficient	
  containers	
  from	
  
any	
  application”
@muktaa
Docker is not a VM
Virtual Machine Docker
@muktaa
FROM	
  ubuntu:14.04
RUN	
  apt-­‐get	
  update
RUN	
  apt-­‐get	
  install	
  libfuse-­‐
dev
ADD	
  dev.conf/etc/myapp-­‐
config/
Dockerfiles
• Codify your configuration
• Set of bash commands
• Example:
• HelloScala
• Dockerfile
• dev.conf
• Docker build HelloScala
@muktaa
Use Cases of Docker
•Microservices
•Lightweight Testing
•Production
•CaaS
•PaaS
@muktaa
Chef and Docker
@muktaa
Config Management Vs Golden Images
•Control the environment Vs System Image /
Runtime image
•Tradeoff between flexibility and manageability
•CM is the vein of DevOps
•Shell scripts -> Chef
•Immutable Infrastructure
@muktaa
Chef and Docker
Replaces	
  Human	
  Tasks,
Idempotence,
Thick	
  client	
  -­‐ thin	
  servers,
Order	
  Matters,
Huge	
  Community	
  Support
An	
  improved	
  Robot,
Fast,
Easy,
Relatively	
  new	
  in	
  the	
  
market!
@muktaa
Simple CD Pipeline
Because simple things can bring the most happiness!
@muktaa
Simple CI/CD Pipeline
•git	
  push
•Triggers	
  
Build
Code
•Build	
   tools	
  
have	
  docker	
  
support
•Build	
   tools	
  
generate	
  a	
  
docker	
  image
Build	
  
Process
Save	
  image
Docker	
  
Image
Unique	
   tag
Docker	
  
Registry
•docker	
  pull	
  
•docker	
  stop
•docker	
  run
Deploy	
  
using	
  knife-­‐
ssh or	
  Push	
  
Jobs
CI	
  Server
@muktaa
The Simple Steps
• git push to https://github.com/muktaa/hello-nodejs
• Triggers a build on your CI server
• npm install, npm test
• docker push muktaa/hello-nodejs
• knifessh 'role:test''deploy.sh' -x ssh-user -i ssh-key-c knife.rb
• Some build tools offer docker integration
• Eg: Maven has docker-maven-plugin
• https://github.com/spotify/docker-maven-plugin
• mvn clean package docker:build -DpushImage
@muktaa
Example
• Git clone https://github.com/muktaa/hello-nodejs/
• <make changes>
• Git add, commit, push
• Jenkins Job runs
• Check image uploaded to docker hub
• Knife-ssh
• URL: http://54.218.32.234:49160/
@muktaa
When Reality Strikes…
If only applications were Hello World programs!
@muktaa
Docker Image
Application Configuration Docker Image
@muktaa
What is Configuration?
Packages Custom	
  SetupsCredentials
Softwares Database
Files
Environment	
  
Specific	
  
Configuration
Ports
@muktaa
ENVIRONMENTS
DEV
Docker
Container
Docker
Container
Docker
Container
PRE	
  
PROD
Docker
Container
Docker
Container
Docker
Container
PROD
Docker
Container
Docker
Container
Docker
Container
@muktaa
Secure Credential Management
•Credentials inside docker containers
•Hard codes
•Set environment variables
•Docker-compose.yml
env_file:
- .env
SOME_USERNAME=myUser
SOME_PWD_VAR=myPwd
@muktaa
Provisioning Machines
• Docker engine
• Ports
• Security groups
• User access
• Eg:
• Knife ec2 server create
@muktaa
Docker Chef Cookbook
To manage docker images and deployment
@muktaa
Docker Cookbook
• Available in Supermarket:
https://supermarket.chef.io/cookbooks/docker
• Install docker
• Build docker image
• Pull image and run container
• Push docker image to registry
• LWRPs
• Docker_container
• Docker_image
• Docker_registry
• https://github.com/bflad/chef-docker/blob/master/README.md
@muktaa
Credential Management
secret = Chef::EncryptedDataBagItem.load_secret
@docker_cred = Chef::EncryptedDataBagItem.load(
node['docker']['creds']['databag'],
node['docker']['user'],
secret
)
docker_registry ‘https://registry.hub.docker.com/u/muktaa/hello-scala/’ do
email docker_cred['email']
username docker_cred['username']
password docker_cred['password']
end
@muktaa
Docker_image
# Build a dockerimage using docker_image resource
docker_image node['docker']['image'] do
tag node['docker']['image']['tag']
source'/var/docker'
action :build
end
# Push the image to docker registery
docker_image node['docker']['image'] do
action :push
end
# Delete the image from the machine
docker_image node['docker']['image'] do
action :remove
end
@muktaa
Docker_container
# Run Container
docker_container ‘muktaa/hello-scala’
detach true
port ‘8081:8081’, ‘8085:8085’
env ‘ENVIRONMENT=pre-prod’
volume ‘/mnt/docker/docker-storage’
action :run
end
@muktaa
GENERATE DOCKERFILE
# Generate a docker file using template.
template "#{node['docker']['directory']}/Dockerfile" do
source 'dockerfile.erb'
variables image: node['docker']['base']['image']['name'],
maintainer:@docker_cred['maintainer'],
email: docker_cred['email'],
build_cmd:node['docker']['build']['commands'],
entry_point: node['docker']['build']['entry_point']
action :create
end
@muktaa
WORKFLOW
Build	
  
Application
• Save	
  the	
  Artifact
Build	
  Docker
Image
• Docker cookbook	
  would	
  build	
  and	
  save	
  the	
  
docker image	
  to	
  Docker hub	
  or	
  DTR
Deploy
• Docker cookbook	
  runs	
  the	
  
container	
  on	
  the	
  nodes
@muktaa
Docker Ecosystem
•Debugging apps in containers
•Docker networking
•Notifications
•Cluster management
•Orchestration
•Schedulers
•Service Discovery
@muktaa
Thank You!
aMukta@gmail.com
Ad

More Related Content

What's hot (20)

Intro to docker
Intro to dockerIntro to docker
Intro to docker
Towfiqul Islam
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
Jirayut Nimsaeng
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker Images
Brian DeHamer
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13
kylog
 
Javaone 2014 - Git & Docker with Jenkins
Javaone 2014 - Git & Docker with JenkinsJavaone 2014 - Git & Docker with Jenkins
Javaone 2014 - Git & Docker with Jenkins
Andy Pemberton
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Docker, Inc.
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
AgileDenver
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith
Docker, Inc.
 
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.
 
Taking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and DecideTaking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
ahunnargikar
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Julia Mateo
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @Orbitz
Docker, Inc.
 
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
Docker, Inc.
 
Introduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes TrainingIntroduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes Training
Shailendra Chauhan
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing docker
Sascha Brinkmann
 
Docker zero
Docker zeroDocker zero
Docker zero
Manuel de la Peña Peña
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
Lalatendu Mohanty
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache MesosCI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
SF DevOps: Introducing Vagrant
SF DevOps: Introducing VagrantSF DevOps: Introducing Vagrant
SF DevOps: Introducing Vagrant
Mitchell Hashimoto
 
Docker Continuous Delivery Workshop
Docker Continuous Delivery WorkshopDocker Continuous Delivery Workshop
Docker Continuous Delivery Workshop
Jirayut Nimsaeng
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker Images
Brian DeHamer
 
Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13Automating Docker Containers with Puppet 2014 10-13
Automating Docker Containers with Puppet 2014 10-13
kylog
 
Javaone 2014 - Git & Docker with Jenkins
Javaone 2014 - Git & Docker with JenkinsJavaone 2014 - Git & Docker with Jenkins
Javaone 2014 - Git & Docker with Jenkins
Andy Pemberton
 
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Build, Publish, Deploy and Test Docker images and containers with Jenkins Wor...
Docker, Inc.
 
Jenkins, pipeline and docker
Jenkins, pipeline and docker Jenkins, pipeline and docker
Jenkins, pipeline and docker
AgileDenver
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith
Docker, Inc.
 
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.
 
Taking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and DecideTaking Docker to Production: What You Need to Know and Decide
Taking Docker to Production: What You Need to Know and Decide
Docker, Inc.
 
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
Delivering eBay's CI Solution with Apache Mesos & Docker - DockerCon 2014
ahunnargikar
 
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconfContinuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Continuous delivery with Jenkins, Docker and Mesos/Marathon - jbcnconf
Julia Mateo
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @Orbitz
Docker, Inc.
 
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
Docker, Inc.
 
Introduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes TrainingIntroduction to Docker | Docker and Kubernetes Training
Introduction to Docker | Docker and Kubernetes Training
Shailendra Chauhan
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing docker
Sascha Brinkmann
 

Similar to Baking Docker Using Chef (20)

Using Docker for Testing - Mukta
Using Docker for Testing - MuktaUsing Docker for Testing - Mukta
Using Docker for Testing - Mukta
Agile Testing Alliance
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
Mukta Aphale
 
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCSOracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Frank Munz
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
damovsky
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
Docker, Inc.
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
damovsky
 
CI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumCI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
James Turnbull
 
Containers and CloudStack
Containers and CloudStackContainers and CloudStack
Containers and CloudStack
ShapeBlue
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
Samuel Chow
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
Prashant Kumar Tyagi
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
ShapeBlue
 
Docker
DockerDocker
Docker
Tomy Rhymond
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel PalstraCohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
Daniel Palstra
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
Web à Québec
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
Docker lxc win
Docker lxc winDocker lxc win
Docker lxc win
rahulmore01
 
Using Docker for Testing
Using Docker for TestingUsing Docker for Testing
Using Docker for Testing
Mukta Aphale
 
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCSOracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Oracle CODE 2017 San Francisco: Docker on Raspi Swarm to OCCS
Frank Munz
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
damovsky
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
dotCloud
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
damovsky
 
CI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and TutumCI, CD with Docker, Jenkins and Tutum
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
Containers and CloudStack
Containers and CloudStackContainers and CloudStack
Containers and CloudStack
ShapeBlue
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
Samuel Chow
 
Sebastien goasguen cloud stack and docker
Sebastien goasguen   cloud stack and dockerSebastien goasguen   cloud stack and docker
Sebastien goasguen cloud stack and docker
ShapeBlue
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
Ramit Surana
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Peng Xiao
 
Cohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel PalstraCohesion Techsessie Docker - Daniel Palstra
Cohesion Techsessie Docker - Daniel Palstra
Daniel Palstra
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
Web à Québec
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
Ad

More from Mukta Aphale (8)

CI with Docker in Docker
CI with Docker in DockerCI with Docker in Docker
CI with Docker in Docker
Mukta Aphale
 
What is DevOps?
What is DevOps?What is DevOps?
What is DevOps?
Mukta Aphale
 
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using Datadog
Mukta Aphale
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
Mukta Aphale
 
What is dev ops?
What is dev ops?What is dev ops?
What is dev ops?
Mukta Aphale
 
MomOps in DevOps
MomOps in DevOpsMomOps in DevOps
MomOps in DevOps
Mukta Aphale
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
Mukta Aphale
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
Mukta Aphale
 
CI with Docker in Docker
CI with Docker in DockerCI with Docker in Docker
CI with Docker in Docker
Mukta Aphale
 
Application Monitoring using Datadog
Application Monitoring using DatadogApplication Monitoring using Datadog
Application Monitoring using Datadog
Mukta Aphale
 
Continuous Testing using Shippable and Docker
Continuous Testing using Shippable and DockerContinuous Testing using Shippable and Docker
Continuous Testing using Shippable and Docker
Mukta Aphale
 
Docker and configuration management
Docker and configuration managementDocker and configuration management
Docker and configuration management
Mukta Aphale
 
Ice breaker with dev ops
Ice breaker with dev opsIce breaker with dev ops
Ice breaker with dev ops
Mukta Aphale
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 

Baking Docker Using Chef

  • 1. @muktaa Baking Docker using Chef Mukta Aphale Agile India Conf 2016, Bangalore +
  • 2. @muktaa Who am I? • C, Ruby, Java developer turned into DevOps Architect • Contributed to Chef development • Chef azure extension • Knife plugins: knife-azure, knife-ec2, knife-openstack • Knife WinRM, knife windows listener • Worked extensively with Docker • Docker authorized consultant • Technology, innovation and the thirst to keep learning are what define me • Love to travel, read, write • Above all, I am a mother to two boys!
  • 3. @muktaa Agenda •The Chef Journey •Container Era •Chef + Docker •Example •Docker cookbook •Example
  • 5. @muktaa Chef Journey • Adam Jacob, Jessie Robbins, Barry Steinglass, Nathan Haneysmith, Joshua Timberman • Marionette • Opscode • First release: Jan 2009 • Ruby, Erlang • Facebook, Nordstorm, Disney, GE • Configuration Management • Cloud Management • Chef Delivery
  • 7. @muktaa Evolution • 2000: Jails, FreeBSD • 2001: Linux-Vserver • 2006: cgroups • 2008: LXC Containers • 2013: Docker • June 2014: Docker 1.0 • Today: Docker 1.10.3
  • 8. @muktaa Docker • Learning curve • No need for huge investment at the early stage • “I wont use Chef for that small deployment” • “Now I have 100 servers. Makes sense to use Chef” • “Now I have 100 containers. How do I manage them?”
  • 10. @muktaa What is Docker? Linux  Container 3  Components: Docker Engine Docker Hub Docker Images Benefits: Speed Portability Density Open  Source “Can  create  lightweight,  self   sufficient  containers  from   any  application”
  • 11. @muktaa Docker is not a VM Virtual Machine Docker
  • 12. @muktaa FROM  ubuntu:14.04 RUN  apt-­‐get  update RUN  apt-­‐get  install  libfuse-­‐ dev ADD  dev.conf/etc/myapp-­‐ config/ Dockerfiles • Codify your configuration • Set of bash commands • Example: • HelloScala • Dockerfile • dev.conf • Docker build HelloScala
  • 13. @muktaa Use Cases of Docker •Microservices •Lightweight Testing •Production •CaaS •PaaS
  • 15. @muktaa Config Management Vs Golden Images •Control the environment Vs System Image / Runtime image •Tradeoff between flexibility and manageability •CM is the vein of DevOps •Shell scripts -> Chef •Immutable Infrastructure
  • 16. @muktaa Chef and Docker Replaces  Human  Tasks, Idempotence, Thick  client  -­‐ thin  servers, Order  Matters, Huge  Community  Support An  improved  Robot, Fast, Easy, Relatively  new  in  the   market!
  • 17. @muktaa Simple CD Pipeline Because simple things can bring the most happiness!
  • 18. @muktaa Simple CI/CD Pipeline •git  push •Triggers   Build Code •Build   tools   have  docker   support •Build   tools   generate  a   docker  image Build   Process Save  image Docker   Image Unique   tag Docker   Registry •docker  pull   •docker  stop •docker  run Deploy   using  knife-­‐ ssh or  Push   Jobs CI  Server
  • 19. @muktaa The Simple Steps • git push to https://github.com/muktaa/hello-nodejs • Triggers a build on your CI server • npm install, npm test • docker push muktaa/hello-nodejs • knifessh 'role:test''deploy.sh' -x ssh-user -i ssh-key-c knife.rb • Some build tools offer docker integration • Eg: Maven has docker-maven-plugin • https://github.com/spotify/docker-maven-plugin • mvn clean package docker:build -DpushImage
  • 20. @muktaa Example • Git clone https://github.com/muktaa/hello-nodejs/ • <make changes> • Git add, commit, push • Jenkins Job runs • Check image uploaded to docker hub • Knife-ssh • URL: http://54.218.32.234:49160/
  • 21. @muktaa When Reality Strikes… If only applications were Hello World programs!
  • 23. @muktaa What is Configuration? Packages Custom  SetupsCredentials Softwares Database Files Environment   Specific   Configuration Ports
  • 25. @muktaa Secure Credential Management •Credentials inside docker containers •Hard codes •Set environment variables •Docker-compose.yml env_file: - .env SOME_USERNAME=myUser SOME_PWD_VAR=myPwd
  • 26. @muktaa Provisioning Machines • Docker engine • Ports • Security groups • User access • Eg: • Knife ec2 server create
  • 27. @muktaa Docker Chef Cookbook To manage docker images and deployment
  • 28. @muktaa Docker Cookbook • Available in Supermarket: https://supermarket.chef.io/cookbooks/docker • Install docker • Build docker image • Pull image and run container • Push docker image to registry • LWRPs • Docker_container • Docker_image • Docker_registry • https://github.com/bflad/chef-docker/blob/master/README.md
  • 29. @muktaa Credential Management secret = Chef::EncryptedDataBagItem.load_secret @docker_cred = Chef::EncryptedDataBagItem.load( node['docker']['creds']['databag'], node['docker']['user'], secret ) docker_registry ‘https://registry.hub.docker.com/u/muktaa/hello-scala/’ do email docker_cred['email'] username docker_cred['username'] password docker_cred['password'] end
  • 30. @muktaa Docker_image # Build a dockerimage using docker_image resource docker_image node['docker']['image'] do tag node['docker']['image']['tag'] source'/var/docker' action :build end # Push the image to docker registery docker_image node['docker']['image'] do action :push end # Delete the image from the machine docker_image node['docker']['image'] do action :remove end
  • 31. @muktaa Docker_container # Run Container docker_container ‘muktaa/hello-scala’ detach true port ‘8081:8081’, ‘8085:8085’ env ‘ENVIRONMENT=pre-prod’ volume ‘/mnt/docker/docker-storage’ action :run end
  • 32. @muktaa GENERATE DOCKERFILE # Generate a docker file using template. template "#{node['docker']['directory']}/Dockerfile" do source 'dockerfile.erb' variables image: node['docker']['base']['image']['name'], maintainer:@docker_cred['maintainer'], email: docker_cred['email'], build_cmd:node['docker']['build']['commands'], entry_point: node['docker']['build']['entry_point'] action :create end
  • 33. @muktaa WORKFLOW Build   Application • Save  the  Artifact Build  Docker Image • Docker cookbook  would  build  and  save  the   docker image  to  Docker hub  or  DTR Deploy • Docker cookbook  runs  the   container  on  the  nodes
  • 34. @muktaa Docker Ecosystem •Debugging apps in containers •Docker networking •Notifications •Cluster management •Orchestration •Schedulers •Service Discovery