lasug online: introduction to docker and docker tools

37
Introduction to Docker and Tools VASILIY FOMICHEV SOLUTIONS ARCHITECT

Upload: vasiliy-fomichev

Post on 12-Jan-2017

601 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: LASUG Online: Introduction to Docker and Docker Tools

Introduction to Docker and Tools

VASILIY FOMICHEVSOLUTIONS ARCHITECT

Page 2: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev2

VASILIY FOMICHEVSOLUTION ARCHITECTVERNDALE

• Sitecore Technology MVP• Technology enthusiast• Passionate about innovation• cmsbestpractices.com

https://www.linkedin.com/in/vasiliyfomichev

@vasiliyfomichev

INTRODUCTION

Page 3: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev3

WHAT ARE WE LOOKING AT?Today’s development modelWhat are “containers”How can docker help in the sitecore world?Demos

Ubuntu on DockerSolr on DockerMongo on DockerDocker Machine

Provision Digital Ocean DropletProvision Azure VM

Where is this headed?

Page 4: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev4

WHAT’S THE PROBLEM?

Page 5: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

DEVOPS CHALLENGES

• Local environment setups are getting more complex• Environment differences allow for bugs in

applications• Manual setup it too complex and time consuming• Human error• Scalability issues on prem• Inability to reproduce production environment

locally for debugging• Inability to easily sync all Sitecore environments• Lack of QA and other types of reproducibility

Page 6: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev6

WHAT ARE “CONTAINERS”?

Page 7: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Before Container Standards

Page 8: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Shipping Containers Invented

https://en.wikipedia.org/wiki/Malcom_McLean

In 1956, most cargo was loaded and unloaded by hand. Hand-loading a ship cost $5.86 a ton.

Malcom McLean born in 1913 developed the modern intermodal shipping container, which revolutionized transport and international trade.

McLean knew "A ship earns money only when she's at sea," and based his business on that efficiency.

Using containers, it cost only 16 cents a ton, a 39-fold savings. Containerization also greatly reduced the time to load and unload ships, improving reliability.

Page 9: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Page 10: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Hosting Containers

Page 11: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Page 12: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Docker is growing (18,000% growth)

Page 13: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Enterprises Rapidly Adopting Docker

Small; 30%

Midsize; 15%

Large; 56%

Company Sizes Using Docker

Page 14: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Container != VM• VM’s• Full instances of the entire OS• Not easily multi-instanced ~SysPrep

• Containers• Layered elements of the OS + Components• Easily Duplicated, Start/Stop• Lightweight OS (Tiny Core Linux & Windows

Server Core)

Page 15: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

How tiny is tiny?• ~24MB download! Whaaaat?!• Runs completely from RAM• Minimal Requirements:• 46MB of RAM• i486DX CPU (introduced in 1989, 50MHz, 8KB

cache)• Recommended Requirements:• 128MB+ of RAM• Pentium 2 CPU

SUGCON NORTH AMERICA 2015 15

Page 16: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Server Core Requirements• Minimum Requirement:• 256-512MB of RAM• 1GHz (x86) or 1.4Ghz (x64)CPU

• Recommended• 512MB+• 2GHz+ CPU

SUGCON NORTH AMERICA 2015 16

Page 17: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Container Comparison• Immutable infrastructure!• Fast startup (lightning fast!)• Portable & light-weight• A unit of deployment• Ease of creation• Each container can become a portion of the

entire app• May have multiple containers that make up one

or more than one app

Page 18: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Why Containers?

Developers

Enable ‘write-once, run-anywhere’ appsEnables microservice architecturesGreat for dev/test of apps and services (thousands available from Docker)Reproducibility

Operations

Portability, Portability, PortabilityStandardized development, QA, and prod environmentsAbstract differences in OS distributions and underlying infrastructureEasily scale-up and scale-down in response to changing business needs

DevOps

Modern DevOps1x every 2 weeks to 100x a day

MTTR 12x fasterAmazon deploys every 11.6 seconds

Page 19: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Hosting Containers

Locally with:• Docker Toolbox (Linux)

• Hyper V (Windows)

Physical Servers• Linux (Linux)

• Windows 2016 TP3 (Windows)

Clouds• Azure (Linux & Windows)

• Digital Ocean (Linux)

• AWS (Linux)

• Google (Linux)

• Rackspace (Linux)

• …etc.

AzureOn Premises Service ProviderLocally

Page 20: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Docker Distribution

Page 21: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Dockerfile

Page 22: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Windows Server Containers

Creation, deployment, and management

Developers build and test apps in containers,

using development environment

i.e. Visual Studio

Containers pushed tocentral repository

Operations automates

deployment and monitors deployed apps from central

repository

1 2

2

3Operations collaborates with developers to provide app metrics and insights

Developers update, iterate, and deploy updated containers

Page 23: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

InfrastructureCloud On Premises Service Provider

Container Technologies

Container ManagementPowerShell OthersDocker

Development

Environments

Others…

Page 24: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichevSUGCON NORTH AMERICA 2015 24

SITECORE AND CONTAINERS

Page 25: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Mongo on docker

• Simple configuration– Single instance– Replica set (development)

• Scaled configuration– Scale horizontally – Sharding– Replica sets

Page 26: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Solr on docker

• Simple configuration– Single instance– Solr Cloud (development)

• Scaled Configuration– Scale horizontally– Sharding– Replica sets– Cloud

Page 27: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Sitecore on Docker (coming!)

• Simple Configuration– Single instance– Scaled CD/CM environments (development)

• Scaled configuration– Highly scaled infrastructure– Load balanced server instances

Page 28: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Docker Hub

• Docker Hub– Base repository– Private vs Public – Solr for Sitecore

Page 29: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev29

Common questions

Page 30: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

1.Docker client versus host• Docker client is a command line interface (CLI) Docker• Docker host is a Linux/Windows VM running Docker daemon

2.Docker Linux and Windows hosts • You can only create the same container as the underlying host VM - Linux host = Linux containers

3.Docker Image vs Docker Container• Image = The definition – literally a single file [My Website]• Container – An instance of an image [3 instances of My Website]

4.Cloud Registry Service and Public Image Repos• Unlimited public repos, one free private or buy private repos• 50,000+ images - Wordpress, Nginx, Redis, MySQL, Logstash, and your images!• Docker Trusted Registry – Dedicated registry application deployable on-premise or direct from Azure

Marketplace

5 common Docker questions

Page 31: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

5 common Docker questions

5. Deployments replace instead of update

“Immutable infrastructure”

Website Update your app using Web Deploy or CI/CD

Docker Replace running

containers using CI, Don’t update the old

container

Page 32: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev32

Complementary tools

Page 33: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Some Other Docker Concepts

ComposeDefine and deploy a multi-container application

SwarmPool of hosts treated as a single unit, control over multi-container environmentsDocker MachineCreate and manage Docker instances locally and on the cloud.

Page 34: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Docker Compose Example

Pull Redis image from Docker hubCreate and Start Redis containerBuild an ASP.NET Docker imageCreate and Start the web image on port 80 with redis environment variables

Page 35: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Docker Swarm

Adds a collection of virtual machines into one logical cluster. Same Docker APIElect a leader to receive commands and send to clusterSchedulerConstraints – set a label on a VM/Node so matching containers use that VM

(ex: region=us-west)Affinities – Filters for labels, image, containers ex: -e affinity:container==frontend)

Various Strategies

Page 36: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Wrapping Up• Containers Ease Development & Ops• Force a conversation of scalable design• Ease of movement (On Prem, AWS, Azure)• Immutable Infrastructure• Use Docker Hub repositories for base

images• Run Solr and Mongo in containers• Run Sitecore in containers (coming soon)

Really soon!

Page 37: LASUG Online: Introduction to Docker and Docker Tools

LASUG ONLINE #1 @vasiliyfomichev

Thank you!

https://www.linkedin.com/in/vasiliyfomichev

@vasiliyfomichev

VASILIY FOMICHEV

http://www.cmsbestpractices.com

Special thanks to Steve Lasker, Microsoft