introduction to containers and docker

32
BADCamp 2015 DevOps Summit Introduction to Containers and Docker @RobLoach

Upload: rob-loach

Post on 13-Feb-2017

301 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Introduction to Containers and Docker

BADCamp 2015DevOps Summit

Introduction to Containers and Docker

@RobLoach

Page 2: Introduction to Containers and Docker

Kalamuna.

I build tools to bring great ideas into reality.

RobLoach

RobLoach

[email protected]

Rob Loach

Page 3: Introduction to Containers and Docker

About UsKalamuna makes the Internet for rabble-rousing organizations driven to tinker, critique, and change the way things are. We specialize in design, strategy, user experience, and development.

Page 4: Introduction to Containers and Docker

Containers

Page 5: Introduction to Containers and Docker

But first….

Page 6: Introduction to Containers and Docker

Why?

Page 7: Introduction to Containers and Docker

I can build environments!

Page 8: Introduction to Containers and Docker

But after a while...

B

Page 9: Introduction to Containers and Docker

“Matrix From Hell”

Page 10: Introduction to Containers and Docker

“Matrix From Hell”

Page 11: Introduction to Containers and Docker

“Matrix From Hell”

Page 12: Introduction to Containers and Docker

Managing and DeployingCode is Hard

Page 13: Introduction to Containers and Docker

Virtualization?

■ VirtualBox

■ VMWare

■ Vagrant

■ Puppet

■ Chef

■ etc

Page 14: Introduction to Containers and Docker

AWESOME!.... Buuuuuuuut

■ Slow performance

■ Images require a lot of space

■ Can be complex to set up

■ Updating takes forever

Page 15: Introduction to Containers and Docker

Containers!

Page 16: Introduction to Containers and Docker

Containers

■ Single-service provider■ Build once, run everywhere■ Re-usable software components■ Bind and link services■ Improve dependency management■ Natively part of Linux runtime■ Shared Kernal-space

Page 17: Introduction to Containers and Docker

Docker

■ Easy to use interface around Containers

■ Single “Dockerfile” configuration■ “Hub” to share environments■ Runs everywhere

Page 18: Introduction to Containers and Docker

Create a Container for each Service

Page 19: Introduction to Containers and Docker

Ship each individual Container

Page 20: Introduction to Containers and Docker

Fixes “Matrix From Hell”

Page 21: Introduction to Containers and Docker

Great Scott!

Page 22: Introduction to Containers and Docker

But how?

Page 23: Introduction to Containers and Docker

1. Install Docker

http://docker.io

Page 24: Introduction to Containers and Docker

2. Create a Dockerfile

FROM UbuntuRUN apt-get install nginxADD . /webEXPOSE 80

Page 25: Introduction to Containers and Docker

3. Build the Image

docker build -t myapp .

Page 26: Introduction to Containers and Docker

4. Run it!

docker run -d -p 80:80 myapp

Page 27: Introduction to Containers and Docker
Page 28: Introduction to Containers and Docker

GIVE ME MORE!

■ Docker Compose

■ Orchestrate and link up a set of containers

■ Docker Swarm

■ Clustering of Docker containers, allowing creation and access to a pool of hosts

■ Docker Hub

■ Registry of Docker containers and images - Privately or Publicly

Page 29: Introduction to Containers and Docker

5. Link Containers with Docker Compose

web: build: . ports: - "80:80" links: - mysqlmysql: image: mysql

Page 30: Introduction to Containers and Docker

6. Share on Docker Hub

Page 31: Introduction to Containers and Docker

KalaBox

Drupal development environment through Docker containers