SlideShare uma empresa Scribd logo
1 de 21
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

Mais conteúdo relacionado

Mais procurados

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 DevOpsandersjanmyr
 
Containers without docker
Containers without dockerContainers without docker
Containers without dockerBen 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 YelpdotCloud
 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureTerry 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 2016Patrick Chanezon
 
Docker - 15 great Tutorials
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great TutorialsJulien Barbier
 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry 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 DockerDocker, Inc.
 
Docker 101 @KACST Saudi HPC 2016
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016Walid 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 registrydotCloud
 
Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2dotCloud
 
An Introduction to Rancher
An Introduction to RancherAn Introduction to Rancher
An Introduction to RancherConner 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 DeploymentsBen 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 guptaDocker, Inc.
 
Amazon Web Services and Docker
Amazon Web Services and DockerAmazon Web Services and Docker
Amazon Web Services and DockerPaolo latella
 
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.
 

Mais procurados (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
 

Destaque

Deploying Containers with Rancher
Deploying Containers with RancherDeploying Containers with Rancher
Deploying Containers with RancherChris Tankersley
 
Automate CI/CD with Rancher
Automate CI/CD with RancherAutomate CI/CD with Rancher
Automate CI/CD with RancherNick 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 2016Shannon Williams
 
Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Rancher: 建立你的牧場艦隊
Rancher: 建立你的牧場艦隊Miles Chou
 
DevOpsDays - Apresentação
DevOpsDays - ApresentaçãoDevOpsDays - Apresentação
DevOpsDays - ApresentaçãoJonathan 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 -- BreizhCamp2016Christophe 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 clickDocker, 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 RancherShannon Williams
 
Visual Studio Visualizers
Visual Studio VisualizersVisual Studio Visualizers
Visual Studio VisualizersJessy 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-nantesChristophe 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 MeetupShannon 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 OpenShiftFrederik 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 ClusterShannon Williams
 
CI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsCI/CD with Openshift and Jenkins
CI/CD with Openshift and JenkinsAri LiVigni
 

Destaque (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
 

Semelhante a 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-2014Carlo Bonamico
 
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 DockerAjeet Singh Raina
 
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 1Liang Bo
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with DockerAndrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with DockerAndrey 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-12dotCloud
 
Application Deployment on Openstack
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on OpenstackDocker, Inc.
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecturejoaquincasares
 
Corwin on Containers
Corwin on ContainersCorwin on Containers
Corwin on ContainersCorwin Brown
 
Common primitives in Docker environments
Common primitives in Docker environmentsCommon primitives in Docker environments
Common primitives in Docker environmentsalexandru giurgiu
 
Docker experience @inbotapp
Docker experience @inbotappDocker experience @inbotapp
Docker experience @inbotappJilles van Gurp
 
Docker interview Questions-2.pdf
Docker interview Questions-2.pdfDocker interview Questions-2.pdf
Docker interview Questions-2.pdfYogeshwaran R
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Henryk Konsek
 

Semelhante a 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.
 

Último

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 

Último (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 

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

Notas do Editor

  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