SlideShare a Scribd company logo
john culviner
github: github.com/johnculviner
blog: johnculviner.com
twitter: @johnculviner
email: john@johnculviner.com
intro to
with a side of
About Me
 Free range, sometimes organic
Full-stack Independent Consultant
@ Veritas in Roseville
 Backend
 DevOps (Docker, Ansible, Linux etc)
 NoSql (ElasticSearch, MongoDB)
 Distributed systems (RabbitMQ, Kafka etc.)
 Node.js
 Groovy/Spring/Java
 C#
 Front End
 Angular.js, React.js, Knockout.js, Durandal.js, jQuery, CSS/SASS etc.
 SPA development
 Open Source “Street Cred”
 AngularAgility
 jQuery File Download
 FluentKnockoutHelpers
Overview
 Docker
 How does it work
 Why would I use it
 Rancher
 What does it give me
 Building a Clustered Docker + Rancher environment from
scratch
 Terraform (DigitalOcean)
 Ansible
 Node.js Microservice
 Objective:
To leave feeling confident about if Docker might make
sense for your next project (or might not!) and how to
get started easily if it looks like it is the right tool for the
job for you.
What is ?
 It’s all about the containers!
Images
Internal Docker Registry
hostname: MY_REG:5000
myapp:1.0
myapp:1.1
yourapp:1.0
yourapp:1.1
…
Public Docker Registry
AKA: hub.docker.com
elasticsearch:5.0.0
elasticsearch:5.0.1
rabbitmq:3.6.4
rabbitmq:3.6.5
…
Any machine running Docker
MY_REG:5000/myapp:1.1
elasticsearch:5.0.1
may equal
when :tag not specified defaults to
Confused? Container vs Image
 A container is an “instance” of an “immutable” image
 Could be running or stopped
My machine running Docker for Mac
Loaded Images
mongo:latest
Running Containers
Image Name
mongo:latest
Container Name
myfirstmongo
Image Name
mongo:latest
Container Name
mysecondmongo
…
Moderate Mongo Mess
 mongo:latest isn’t terribly useful to know what the version really is
 There is no external/port level access to the containers
 There are no volume mounts for persistent data (very bad for perf
on with high I/O applications)
 If the container dies it’s not coming up again without me restarting
it
 Fortunately? there is:
docker run --name=myfirstmongo --detach --publish="27017:27017" --
restart=always --volume="/some/local/path:/data/db" mongo
A better way: docker-compose
 Tearse & readily source controlled YAML definition
 docker-compose.yml
Idempotence
(to an extent)
docker-compose for CI/CD!
 Run isolated integration testing CI/CD of your whole app
stack from anywhere! (local, Jenkins etc.)
Builds a local Dockerfile
Define DNS aliases of references
only available from my_app
stdout/err comes out to
pass/fail Jenkins build
Test command: stdout/err
comes out of container to
pass/fail the build
Mongo only addressable to
my_app at DNS “mongodb”
No stdout/err
Real live chrome/selenium
server in a container using xvfb
Benefits of Images & Containers
 Better Isolation & Consistency with Images
 Docker Repository vs. Artifactory, NPM, Nuget etc.
 Debug a production image on my local machine
 EX: Run 10 different YOUR_FAV_LANG apps using 10
different versions the runtime all on port 8080 on same
box*
 *with a SDN (software defined network)
 Security*
 *When you don’t run as root, use SELinux,
sandbox volumes among other things
+Docker
Building images with layers
 Done with a Dockerfile, lets do it!
 See layers with “docker inspect IMAGE_NAME”
 What we did:
image layer: alpine:latest
image layer: first_file added
image layer: second_file added
container: second-container
container: first-container
Layer re-creation/sharing
 Docker will re-use existing layers when it can:
 When a layer changes subsequent layers are invalidated otherwise they are
re-used
 This effects:
Proportion of
Image Size
Changes every build
(probably)
npm install only runs
if package.json
(a dependency/package manifest)
changes!
pull/push HTTP traffic
server filesystem usage repository storage space
BUILD TIMES!
Docker Observations
 Set up development environment quickly
with a docker-compose for a project
 E2E Integration testing easily with a docker-compose
 Image consistency to production
 stdout/stderr aggregation
QA servers
myapp:1.2.3
PROD servers
myapp:1.2.3
DEV servers
myapp:1.2.3
- Commit
- Build
- Test
deploy
server-a
server-b
server-c
server-d
ElasticSearch
+
Kibana
stdout/err from
all containers
Well that was cool for DEV but…
 How do I run containers on multiple machines and
orchestrate them?
 How do I ensure HA (high availability)
 How do I load balance HTTP/S applications
 How do I schedule based on load
Does Docker actually make sense to
run real applications in PROD?
*well I have at least with less work and less
downtime than other approaches I’ve
encountered… so far
Partial lay of the land*
*as I see it: grain of salt please
+
What is ?
 A really slick UI that illustrates what is going on in a
very clear manner
 Actually helps you learn real Docker (full API surface
almost!) visually and then helps you script things after you
have “pointed and clicked your way to success”
 Easily runs in Docker container(s)
 Container orchestration/clustering support for a variety
of different platforms:
What is Cattle?
 A relatively simple container orchestration framework that is
natively supported by Rancher
 Pros
 Built in layer 5 (haproxy based) load balancer that supports
scaling, rolling upgrades, rollback changes etc.
 Slick SDN (Software Defined Network) does DNS based round-
robin inter-container network resolution
 Simpler & quicker to get going than anything else
 “3AM Googleability” is very high / vibrant community
 Works with Docker rather than against it
 Realistically free!
 I’ve battle tested it and has worked well so far
 Cons
 Scheduler is rather simple / no automatic container creation
support
+ +
 Setup entire stack from scratch in a repeatable
(idempotent), clear & source controllable manner
 *Some of the Rancher stuff we will “point and click our
way to success” for brevity and to show you the UI but
I’ve done it before with 100% Ansible + docker/rancher-
compose files.
 Requirements
 POSIX shell
 DigitalOcean account with API key env variable
 SSH
 ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub setup
 Ansible (get with Python, PIP)
 Terraform
 Web browser
The
Goal
docker0 docker2docker1 docker3
rancher/server
rancher/agent
rancher/agent rancher/agent rancher/agent
Idempotent Cloud VM
creation tool
Cloud VM Provider
Ubuntu
16.04
Cloud VMs
w/
Containers
Idempotent
Server
Provisioning
Tool
johnculviner/
nodejs-echo-hostname
johnculviner/
nodejs-echo-hostname
johnculviner/
nodejs-echo-hostname
johnculviner/
nodejs-echo-hostname
johnculviner/
nodejs-echo-hostname
johnculviner/
nodejs-echo-hostname
…… …
rancher haproxy
load balancer
HTTP
Traffic
+ few SSH commands
The code
https://github.com/johnculviner/doc
ker-rancher-presentation
E2E IRL Ideas
A Jenkins pipeline build
questions/comments?
john culviner
github: github.com/johnculviner
blog: johnculviner.com
twitter: @johnculviner
email: john@johnculviner.com

More Related Content

What's hot

How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker
Jonathan Martin
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
andersjanmyr
 
Containers without docker
Containers without dockerContainers without docker
Containers without docker
Ben Hall
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
dotCloud
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
Terry Chen
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
Patrick Chanezon
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
Patrick Chanezon
 
Docker & Kubernetes intro
Docker & Kubernetes introDocker & Kubernetes intro
Docker & Kubernetes intro
Arnon Rotem-Gal-Oz
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great Tutorials
Julien Barbier
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
Larry Cai
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
Docker, Inc.
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Walid Shaari
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2
dotCloud
 
An Introduction to Rancher
An Introduction to RancherAn Introduction to Rancher
An Introduction to Rancher
Conner Swann
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall
 
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun guptaDocker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker, Inc.
 
Amazon Web Services and Docker
Amazon Web Services and DockerAmazon Web Services and Docker
Amazon Web Services and Docker
Paolo latella
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Red Hat Developers
 
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.
 

What's hot (20)

How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker How we dockerized a startup? #meetup #docker
How we dockerized a startup? #meetup #docker
 
Docker, the Future of DevOps
Docker, the Future of DevOpsDocker, the Future of DevOps
Docker, the Future of DevOps
 
Containers without docker
Containers without dockerContainers without docker
Containers without docker
 
Building a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from YelpBuilding a smarter application Stack by Tomas Doran from Yelp
Building a smarter application Stack by Tomas Doran from Yelp
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
Docker 101 Checonf 2016
Docker 101 Checonf 2016Docker 101 Checonf 2016
Docker 101 Checonf 2016
 
Docker & Kubernetes intro
Docker & Kubernetes introDocker & Kubernetes intro
Docker & Kubernetes intro
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great Tutorials
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
 
Docker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registryDocker worshop @Twitter - How to use your own private registry
Docker worshop @Twitter - How to use your own private registry
 
Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2
 
An Introduction to Rancher
An Introduction to RancherAn Introduction to Rancher
An Introduction to Rancher
 
Architecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
 
Docker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun guptaDocker for Java Developers - Fabiane Nardon and Arun gupta
Docker for Java Developers - Fabiane Nardon and Arun gupta
 
Amazon Web Services and Docker
Amazon Web Services and DockerAmazon Web Services and Docker
Amazon Web Services and Docker
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
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
 

Viewers also liked

Deploying Containers with Rancher
Deploying Containers with RancherDeploying Containers with Rancher
Deploying Containers with Rancher
Chris Tankersley
 
WTF Is Rancher?
WTF Is Rancher?WTF Is Rancher?
WTF Is Rancher?
Chris Tankersley
 
Automate CI/CD with Rancher
Automate CI/CD with RancherAutomate CI/CD with Rancher
Automate CI/CD with Rancher
Nick Thomas
 
Node.js and MongoDB from scratch, fully explained and tested
Node.js and MongoDB from scratch, fully explained and tested Node.js and MongoDB from scratch, fully explained and tested
Node.js and MongoDB from scratch, fully explained and tested
John Culviner
 
More tips and tricks for running containers like a pro - Rancher Online MEetu...
More tips and tricks for running containers like a pro - Rancher Online MEetu...More tips and tricks for running containers like a pro - Rancher Online MEetu...
More tips and tricks for running containers like a pro - Rancher Online MEetu...
Shannon Williams
 
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Shannon Williams
 
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
Shannon Williams
 
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
Miles Chou
 
DevOpsDays - Apresentação
DevOpsDays - ApresentaçãoDevOpsDays - Apresentação
DevOpsDays - Apresentação
Jonathan Baraldi
 
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
Christophe Furmaniak
 
Deploy and upgrade Docker applications with a single click
Deploy and upgrade Docker applications with a single clickDeploy and upgrade Docker applications with a single click
Deploy and upgrade Docker applications with a single click
Docker, Inc.
 
Building a Scalable CI Platform using Docker, Drone and Rancher
Building a Scalable CI  Platform using Docker, Drone and RancherBuilding a Scalable CI  Platform using Docker, Drone and Rancher
Building a Scalable CI Platform using Docker, Drone and Rancher
Shannon Williams
 
OpenShift y PostgreSQL
OpenShift y PostgreSQLOpenShift y PostgreSQL
Visual Studio Visualizers
Visual Studio VisualizersVisual Studio Visualizers
Visual Studio Visualizers
Jessy Houle
 
Rex docker en production meeutp-docker-nantes
Rex docker en production meeutp-docker-nantesRex docker en production meeutp-docker-nantes
Rex docker en production meeutp-docker-nantes
Christophe Furmaniak
 
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online MeetupIntroducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Shannon Williams
 
Modernizing Your Enterprise Application Architecture with Microservices and A...
Modernizing Your Enterprise Application Architecture with Microservices and A...Modernizing Your Enterprise Application Architecture with Microservices and A...
Modernizing Your Enterprise Application Architecture with Microservices and A...
andreas kuncoro
 
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
Dev Ops and PaaS - Accelerate Application Delivery with OpenShiftDev Ops and PaaS - Accelerate Application Delivery with OpenShift
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
Frederik Bijlsma
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes Cluster
Shannon Williams
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and Jenkins
Ari LiVigni
 

Viewers also liked (20)

Deploying Containers with Rancher
Deploying Containers with RancherDeploying Containers with Rancher
Deploying Containers with Rancher
 
WTF Is Rancher?
WTF Is Rancher?WTF Is Rancher?
WTF Is Rancher?
 
Automate CI/CD with Rancher
Automate CI/CD with RancherAutomate CI/CD with Rancher
Automate CI/CD with Rancher
 
Node.js and MongoDB from scratch, fully explained and tested
Node.js and MongoDB from scratch, fully explained and tested Node.js and MongoDB from scratch, fully explained and tested
Node.js and MongoDB from scratch, fully explained and tested
 
More tips and tricks for running containers like a pro - Rancher Online MEetu...
More tips and tricks for running containers like a pro - Rancher Online MEetu...More tips and tricks for running containers like a pro - Rancher Online MEetu...
More tips and tricks for running containers like a pro - Rancher Online MEetu...
 
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
 
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
 
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊
 
DevOpsDays - Apresentação
DevOpsDays - ApresentaçãoDevOpsDays - Apresentação
DevOpsDays - Apresentação
 
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
Rancher, l'orchestrateur qui vous veut du bien -- BreizhCamp2016
 
Deploy and upgrade Docker applications with a single click
Deploy and upgrade Docker applications with a single clickDeploy and upgrade Docker applications with a single click
Deploy and upgrade Docker applications with a single click
 
Building a Scalable CI Platform using Docker, Drone and Rancher
Building a Scalable CI  Platform using Docker, Drone and RancherBuilding a Scalable CI  Platform using Docker, Drone and Rancher
Building a Scalable CI Platform using Docker, Drone and Rancher
 
OpenShift y PostgreSQL
OpenShift y PostgreSQLOpenShift y PostgreSQL
OpenShift y PostgreSQL
 
Visual Studio Visualizers
Visual Studio VisualizersVisual Studio Visualizers
Visual Studio Visualizers
 
Rex docker en production meeutp-docker-nantes
Rex docker en production meeutp-docker-nantesRex docker en production meeutp-docker-nantes
Rex docker en production meeutp-docker-nantes
 
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online MeetupIntroducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
 
Modernizing Your Enterprise Application Architecture with Microservices and A...
Modernizing Your Enterprise Application Architecture with Microservices and A...Modernizing Your Enterprise Application Architecture with Microservices and A...
Modernizing Your Enterprise Application Architecture with Microservices and A...
 
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
Dev Ops and PaaS - Accelerate Application Delivery with OpenShiftDev Ops and PaaS - Accelerate Application Delivery with OpenShift
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes Cluster
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and Jenkins
 

Similar to Intro to Docker and clustering with Rancher from scratch

Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Codemotion
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
Carlo Bonamico
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Docker intro
Docker introDocker intro
Docker intro
Frei Zhang
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
Ajeet Singh Raina
 
Demystifying Docker101
Demystifying Docker101Demystifying Docker101
Demystifying Docker101
Ajeet Singh Raina
 
Demystifying Docker
Demystifying DockerDemystifying Docker
Demystifying Docker
Cloud Native Bangalore
 
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Carlos Sanchez
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
Andrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
Andrey Hristov
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
dotCloud
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
Docker, Inc.
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
joaquincasares
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on Containers
Corwin Brown
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
alexandru giurgiu
 
Docker experience @inbotapp
Docker experience @inbotappDocker experience @inbotapp
Docker experience @inbotapp
Jilles van Gurp
 
Docker and java
Docker and javaDocker and java
Docker and java
Anthony Dahanne
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
Yogeshwaran R
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
Henryk Konsek
 

Similar to Intro to Docker and clustering with Rancher from scratch (20)

Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Docker intro
Docker introDocker intro
Docker intro
 
A Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using DockerA Shift from Monolith to Microservice using Docker
A Shift from Monolith to Microservice using Docker
 
Demystifying Docker101
Demystifying Docker101Demystifying Docker101
Demystifying Docker101
 
Demystifying Docker
Demystifying DockerDemystifying Docker
Demystifying Docker
 
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
Using Containers for Building and Testing: Docker, Kubernetes and Mesos. FOSD...
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on Containers
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environments
 
Docker experience @inbotapp
Docker experience @inbotappDocker experience @inbotapp
Docker experience @inbotapp
 
Docker and java
Docker and javaDocker and java
Docker and java
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdf
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 

Recently uploaded

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
kalichargn70th171
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 

Recently uploaded (20)

Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 

Intro to Docker and clustering with Rancher from scratch

  • 1. john culviner github: github.com/johnculviner blog: johnculviner.com twitter: @johnculviner email: john@johnculviner.com intro to with a side of
  • 2. About Me  Free range, sometimes organic Full-stack Independent Consultant @ Veritas in Roseville  Backend  DevOps (Docker, Ansible, Linux etc)  NoSql (ElasticSearch, MongoDB)  Distributed systems (RabbitMQ, Kafka etc.)  Node.js  Groovy/Spring/Java  C#  Front End  Angular.js, React.js, Knockout.js, Durandal.js, jQuery, CSS/SASS etc.  SPA development  Open Source “Street Cred”  AngularAgility  jQuery File Download  FluentKnockoutHelpers
  • 3. Overview  Docker  How does it work  Why would I use it  Rancher  What does it give me  Building a Clustered Docker + Rancher environment from scratch  Terraform (DigitalOcean)  Ansible  Node.js Microservice  Objective: To leave feeling confident about if Docker might make sense for your next project (or might not!) and how to get started easily if it looks like it is the right tool for the job for you.
  • 4. What is ?  It’s all about the containers!
  • 5. Images Internal Docker Registry hostname: MY_REG:5000 myapp:1.0 myapp:1.1 yourapp:1.0 yourapp:1.1 … Public Docker Registry AKA: hub.docker.com elasticsearch:5.0.0 elasticsearch:5.0.1 rabbitmq:3.6.4 rabbitmq:3.6.5 … Any machine running Docker MY_REG:5000/myapp:1.1 elasticsearch:5.0.1 may equal when :tag not specified defaults to
  • 6. Confused? Container vs Image  A container is an “instance” of an “immutable” image  Could be running or stopped My machine running Docker for Mac Loaded Images mongo:latest Running Containers Image Name mongo:latest Container Name myfirstmongo Image Name mongo:latest Container Name mysecondmongo …
  • 7. Moderate Mongo Mess  mongo:latest isn’t terribly useful to know what the version really is  There is no external/port level access to the containers  There are no volume mounts for persistent data (very bad for perf on with high I/O applications)  If the container dies it’s not coming up again without me restarting it  Fortunately? there is: docker run --name=myfirstmongo --detach --publish="27017:27017" -- restart=always --volume="/some/local/path:/data/db" mongo
  • 8. A better way: docker-compose  Tearse & readily source controlled YAML definition  docker-compose.yml Idempotence (to an extent)
  • 9. docker-compose for CI/CD!  Run isolated integration testing CI/CD of your whole app stack from anywhere! (local, Jenkins etc.) Builds a local Dockerfile Define DNS aliases of references only available from my_app stdout/err comes out to pass/fail Jenkins build Test command: stdout/err comes out of container to pass/fail the build Mongo only addressable to my_app at DNS “mongodb” No stdout/err Real live chrome/selenium server in a container using xvfb
  • 10. Benefits of Images & Containers  Better Isolation & Consistency with Images  Docker Repository vs. Artifactory, NPM, Nuget etc.  Debug a production image on my local machine  EX: Run 10 different YOUR_FAV_LANG apps using 10 different versions the runtime all on port 8080 on same box*  *with a SDN (software defined network)  Security*  *When you don’t run as root, use SELinux, sandbox volumes among other things +Docker
  • 11. Building images with layers  Done with a Dockerfile, lets do it!  See layers with “docker inspect IMAGE_NAME”  What we did: image layer: alpine:latest image layer: first_file added image layer: second_file added container: second-container container: first-container
  • 12. Layer re-creation/sharing  Docker will re-use existing layers when it can:  When a layer changes subsequent layers are invalidated otherwise they are re-used  This effects: Proportion of Image Size Changes every build (probably) npm install only runs if package.json (a dependency/package manifest) changes! pull/push HTTP traffic server filesystem usage repository storage space BUILD TIMES!
  • 13. Docker Observations  Set up development environment quickly with a docker-compose for a project  E2E Integration testing easily with a docker-compose  Image consistency to production  stdout/stderr aggregation QA servers myapp:1.2.3 PROD servers myapp:1.2.3 DEV servers myapp:1.2.3 - Commit - Build - Test deploy server-a server-b server-c server-d ElasticSearch + Kibana stdout/err from all containers
  • 14. Well that was cool for DEV but…  How do I run containers on multiple machines and orchestrate them?  How do I ensure HA (high availability)  How do I load balance HTTP/S applications  How do I schedule based on load Does Docker actually make sense to run real applications in PROD? *well I have at least with less work and less downtime than other approaches I’ve encountered… so far
  • 15. Partial lay of the land* *as I see it: grain of salt please +
  • 16. What is ?  A really slick UI that illustrates what is going on in a very clear manner  Actually helps you learn real Docker (full API surface almost!) visually and then helps you script things after you have “pointed and clicked your way to success”  Easily runs in Docker container(s)  Container orchestration/clustering support for a variety of different platforms:
  • 17. What is Cattle?  A relatively simple container orchestration framework that is natively supported by Rancher  Pros  Built in layer 5 (haproxy based) load balancer that supports scaling, rolling upgrades, rollback changes etc.  Slick SDN (Software Defined Network) does DNS based round- robin inter-container network resolution  Simpler & quicker to get going than anything else  “3AM Googleability” is very high / vibrant community  Works with Docker rather than against it  Realistically free!  I’ve battle tested it and has worked well so far  Cons  Scheduler is rather simple / no automatic container creation support
  • 18. + +  Setup entire stack from scratch in a repeatable (idempotent), clear & source controllable manner  *Some of the Rancher stuff we will “point and click our way to success” for brevity and to show you the UI but I’ve done it before with 100% Ansible + docker/rancher- compose files.  Requirements  POSIX shell  DigitalOcean account with API key env variable  SSH  ~/.ssh/id_rsa + ~/.ssh/id_rsa.pub setup  Ansible (get with Python, PIP)  Terraform  Web browser
  • 19. The Goal docker0 docker2docker1 docker3 rancher/server rancher/agent rancher/agent rancher/agent rancher/agent Idempotent Cloud VM creation tool Cloud VM Provider Ubuntu 16.04 Cloud VMs w/ Containers Idempotent Server Provisioning Tool johnculviner/ nodejs-echo-hostname johnculviner/ nodejs-echo-hostname johnculviner/ nodejs-echo-hostname johnculviner/ nodejs-echo-hostname johnculviner/ nodejs-echo-hostname johnculviner/ nodejs-echo-hostname …… … rancher haproxy load balancer HTTP Traffic + few SSH commands The code https://github.com/johnculviner/doc ker-rancher-presentation
  • 20. E2E IRL Ideas A Jenkins pipeline build
  • 21. questions/comments? john culviner github: github.com/johnculviner blog: johnculviner.com twitter: @johnculviner email: john@johnculviner.com

Editor's Notes

  1. (already done) docker pull mongo docker images docker run --name=myfirstmongo mongo INTERACTIVE SHELL WHOOPS! docker run --detached --name=myfirstmongo mongo CONTAINER ALREADY EXISTS WHOOPS! docker ps docker ps -a docker rm myfirstmongo docker run --detached --name=myfirstmongo mongo docker run --detached --name=mysecondmongo mongo docker ps
  2. docker build -t first-image . docker run --name first-container first-image docker ps --a docker run -it first-container sh UNCOMMENT COPY SECOND FILE docker build -t second-image . docker run --name second-container second-image