Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

46
DOCKER AS A MULTITOOL MARTIN SEREINIG

Transcript of Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

Page 1: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DOCKER AS A MULTITOOLMARTIN SEREINIG

Page 2: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DOCKER AS A MULTITOOL

AGENDA

▸ What’s Usersnap?

▸ A short history of web application complexity

▸ Devops with Docker

▸ Devops with Docker

▸ Random Docker

▸ Lessons learned

Page 3: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017
Page 4: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

WHAT’S USERSNAP

USERSNAP

▸ Very honored to be a sponsor today

▸ SaaS company

▸ Visual bug tracking & feedback: Usersnap

▸ Established 2013, located in Linz

▸ Over 1000+ customers from all over the world

▸ Currently 15+ employees

Page 5: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017
Page 6: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017
Page 7: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

WE ARE HIRING!

Page 8: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 9: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 10: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 11: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 12: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 13: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 14: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 15: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 16: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

Page 17: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

▸ Content Delivery Network

▸ Payments

▸ Sending Email

▸ Logging / Monitoring

▸ Storage

▸ Backups

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

THAT’S NOT EVEN ALL!

Page 18: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

Page 19: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

DOCKER 101

▸ Docker

▸ Really lightweight VMs

▸ Images are classes, Containers are instances

▸ docker-compose

▸ Orchestrate multiple containers

▸ Configure through one file

Page 20: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

(DEVOPS) REALITY IN A STARTUP ENVIRONMENT

▸ not a lot of people

▸ everybody wears a lot of hats

▸ time is the most valuable resource

▸ there is no IT department

Page 21: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

OPS WITH DOCKER: GOALS

▸ Be able to run it all

▸ … reliably

▸ … and keep it running

▸ Fast and easy provisioning

▸ Easy scaling

▸ Save Time

Page 22: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

OPS WITH DOCKER: IMPLEMENTATION

▸ Nothing but the core competency

▸ Use what you know

▸ Docker host machines run on standard Linux

▸ Docker to build frontend application

▸ Deploy containers for the backend

▸ We’re on AWS, but it does not really matter!

Page 23: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

❌ ❌

Page 24: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

CONTINUOUS INTEGRATION

▸ Codeship connected to repository

▸ Every push triggers: linting, testing, …

▸ Push in master triggers staging build + deploy

▸ Push with release tag triggers release build

▸ Manual deploy

Page 25: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

SCALING

▸ Vertically

▸ Horizontally

▸ Provision new application servers with Ansible

▸ Deploy to new application server

▸ Add to load balancer

▸ Very quick. Could even be automated through API calls

Page 26: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

Page 27: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

DOCKER IN DEVELOPMENT: PROBLEM

▸ Remember the diagram from before?

▸ Dev environment as similar to production as possible

▸ Different versions of software, configuration locations, …

▸ People run different operating systems

Page 28: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

DOCKER IN DEVELOPMENT: SOLUTIONS

▸ Use a different environment than in production?

▸ Have a development server with everything installed?

▸ Run everything locally?

Page 29: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVOPS WITH DOCKER

DOCKER IN DEVELOPMENT

▸ Install Docker

▸ Install git

▸ git pull

▸ docker-compose up

▸ ☕

▸ Start working

Page 30: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

Page 31: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

"I SUPPOSE IT IS TEMPTING, IF THE ONLY TOOL YOU HAVE IS A HAMMER, TO TREAT EVERYTHING AS IF IT WERE A NAIL."

Abraham H. Maslow

RANDOM DOCKER

Page 32: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

USERSNAP BLOG

▸ Wordpress, MySQL, Optimus Cache Prime, Backup

▸ Dockerized!

▸ Data stored through volume mount

Page 33: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

APPLICATION DEMO PROJECT

▸ Did I mention we are hiring?

▸ Applicants make a little demo project

▸ Can choose their tools

▸ Different people will look at the project

▸ Dockerized!

Page 34: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

ANALYTICS SCRIPTS

▸ People do reporting, etc.

▸ Not necessarily developers

▸ Dockerized!

Page 35: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

WORDPRESS PLUGIN

▸ Wordpress Plugin to integrate Usersnap

▸ Dockerized!

▸ MySQL, Wordpress stock images

▸ Plugin is linked into plugin folder

Page 36: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

BUILDING OUR HOMEPAGE

▸ Static page build with Hugo

▸ Again: Not only developers make changes

▸ Dockerized!

Page 37: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

RANDOM DOCKER

RESISTANCE IS FUTILE!

Page 38: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

LESSONS LEARNED

Page 39: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

DEVELOPMENT ENVIRONMENT IS A VERY GOOD START.

LESSONS LEARNED

Page 40: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

ALWAYS USE DOCKER-COMPOSE!

LESSONS LEARNED

Page 41: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

USE DOCKER VOLUMES TO LINK FILES AND PERSIST DATA.

LESSONS LEARNED

Page 42: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

BASH (OR WHATEVER INTERACTIVE COMMAND) INTO A RUNNING CONTAINER

LESSONS LEARNED

Page 43: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

USE A DOCKER-COMPOSE .ENV FILE TO SET A COMPOSE PROJECT NAME

LESSONS LEARNED

Page 44: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

MAC AND WINDOWS: MEH.

LESSONS LEARNED

(OR IS IT?)

Page 45: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

THANKS!MARTIN SEREINIG TWITTER: @SRECNIG EMAIL: [email protected]

Page 46: Docker as a Multitool: DevOps with Docker at Azure Bootcamp Linz 2017

CREATIVE COMMONS IMAGE CREDITShttps://commons.wikimedia.org/wiki/File:NeXTcube.jpg

https://commons.wikimedia.org/wiki/File:Ic_cloud_queue_48px.svg https://www.flickr.com/photos/peterscherub/27148813372

https://commons.wikimedia.org/wiki/File:Modern_Zamanlar_Filmi.jpg https://commons.wikimedia.org/wiki/File:STS-110_Launch.jpg

https://commons.wikimedia.org/wiki/File:Container_ships_President_Truman_(IMO_8616283)_and_President_Kennedy_(IMO_8616295)_at_San_Francisco.jpg https://commons.wikimedia.org/wiki/File:Puzzle_pieces_1.JPG

https://commons.wikimedia.org/wiki/File:Wikimedia_Foundation_Servers-8055_14.jpg https://vimeo.com/107667129

https://www.flickr.com/photos/134416355@N07/31518965950 http://www.publicdomainpictures.net/view-image.php?large=1&image=20992

https://www.flickr.com/photos/daveseven/6138666188 https://commons.wikimedia.org/wiki/File:Cmglee_Container_City_2.jpg

https://commons.wikimedia.org/wiki/File:Heiwa_elementary_school_18.jpg https://commons.wikimedia.org/wiki/File:Fast_Moving_Train_India.jpg

https://commons.wikimedia.org/wiki/File:Bell_X-1B_cockpit_2_USAF.jpg https://commons.wikimedia.org/wiki/File:

2013-06-28_14_19_06_View_of_the_Jarbidge_Mountains_of_Nevada_from_the_end_of_pavement_on_Three_Creek_Road_near_Murphy%27s_Hot_Springs_in_Idaho.jpg

https://commons.wikimedia.org/wiki/File:Wenger_EvoGrip_S17.JPG