Why to docker

29
Why to Docker? Karthik Gaekwad @iteration1

Transcript of Why to docker

Why to Docker?Karthik Gaekwad

@iteration1

Karthik GaekwadSenior Engineer

Previous

11 years of building software for large and small enterprises

Karthik Gaekwad•Lead Organizer Devopsdays Austin•Lead Organizer CloudAustin•Agile Conference 2014/15:

•DevOps track reviewer

Objectives•What is Docker•Why is it so popular•How are enterprises using it today•Questions!

Quick Note:

Feel free to ask any questions you may have in the question box. If I can’t answer it during

the presentation, I’ll write a blog with answers on stackengine.com

What is Docker?

Open source platform for developers and sysadmins to build, ship and run distributed applications anywhere.

Docker Ecosystem•Docker Engine

•Runtime and packaging tool•Installed on hosts that run Docker

•Docker Hub•Cloud Service for storing and sharing applications

•Saving images (public/private)

Docker Features•Portability•Standardized Environments•Rapid scale-up/scale-down•Ability to build a continuous delivery (CD) pipeline

•Dependency management

Portability

Portability• Idea of writing once and running anywhere.

•As long as your application is Dockerized, you can run it anywhere that has the Docker Engine installed.

•Easy to change from 1 host to another.•Flexibility to change underlying infrastructure/operating systems etc.

•Change from 1 cloud provider to another.

Standardized Environments

Standardized Environments• Coding environments can be made consistent from

development ->staging->QA->production.• Per environment configurations are fed in the same

way to each container which reduces configuration issues.

• Time spent debugging environmental issues is reduced drastically.

• Developers understand the production environment better, which leads to better code quality.

No more this:

Scaling

Scaling•Containers take seconds to deploy.•Scale up and down your infrastructure is a lot faster than traditional configuration management tools.

Building pipelines

Continuous Delivery/Deployment• Docker API’s and Docker Hub make it easy to build a

deployment pipeline.• After successful builds, a CI system can build and push a

Docker image to the Hub/private Docker repo.• Deploy new containers to desired environment on a periodic

basis/trigger webhooks to deploy.• Detailed example later..

Dependency Hell

Minimize Dependency Hell

•Dependency hell happens when:• 2 running Java or Ruby applications that depend on

different versions of the same library…..•How Docker can help:

• Isolate each application (along with it’s dependencies) so that they can be loaded in their own container.

• 1 container for 1 application or service (micro service architecture)

Real World Examples

Standardized Environments• Starting point for most organizations to use Docker.• Take existing (or new) applications, containerize them, run

them the same way on dev/stage/production.• Examples on Docker.com: Orbitz, Uber• @StackEngine:

• All our infrastructure run in containers.• Every code push builds a new container for the application.• All environments uses the same command to run the application:• sudo docker run -d -p 7777:7777 -e SE_DB=‘db_val’

stackengine/admin

Pipelines• Most common usecase of how people use Docker today.• Examples on Docker.com: Business Insider, Spotify, Yelp• @StackEngine:

• Code is commit to github; triggers a build with CircleCI.• Successful build results in a built container that is deployed to a

private registry.• Successful push to registry triggers a webhook to the StackEngine

product.• StackEngine redeploys new container to production.• 4 minute turnaround from commit->running in production.

Multi tenancy applications

•Single Tenant application-> Multi tenant application by launching multiple instances of the same application in different containers.

•http://flux7.com/docker/

Other use cases•Running a PaaS

•Running entire datacenters using Docker. •EngineYard/Yandex/Baidu are great examples of this.

•Hosting Legacy Applications•Containerizing hard to run applications is becoming a frequent usecase.

Docker in Production?•Great blog post summarizing current challenges: http://sirupsen.com/production-docker/

•Already made huge strides in networking/log management.

•Recommendation:•Start small, learn, adapt, expand.

Players in the space

How to Docker?

Resources for learning Docker:

•Docker 101 (@behemphi): http://stackengine.com/docker-101-01-docker-development-environments/

•Docker Tutorials by John Willis: https://blog.docker.com/author/john-willis/

•The Docker Book- James Turnbull

Thank You!

Reach me on @iteration1 for any Docker related questions