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

Post on 23-Jan-2018

225 views 3 download

transcript

DOCKER AS A MULTITOOLMARTIN SEREINIG

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

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

WE ARE HIRING!

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

▸ Content Delivery Network

▸ Payments

▸ Sending Email

▸ Logging / Monitoring

▸ Storage

▸ Backups

A SHORT HISTORY OF WEB APPLICATION COMPLEXITY

THAT’S NOT EVEN ALL!

DEVOPS WITH DOCKER

DEVOPS WITH DOCKER

DOCKER 101

▸ Docker

▸ Really lightweight VMs

▸ Images are classes, Containers are instances

▸ docker-compose

▸ Orchestrate multiple containers

▸ Configure through one file

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

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

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!

DEVOPS WITH DOCKER

❌ ❌

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

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

DEVOPS WITH DOCKER

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

DEVOPS WITH DOCKER

DOCKER IN DEVELOPMENT: SOLUTIONS

▸ Use a different environment than in production?

▸ Have a development server with everything installed?

▸ Run everything locally?

DEVOPS WITH DOCKER

DOCKER IN DEVELOPMENT

▸ Install Docker

▸ Install git

▸ git pull

▸ docker-compose up

▸ ☕

▸ Start working

RANDOM DOCKER

"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

RANDOM DOCKER

USERSNAP BLOG

▸ Wordpress, MySQL, Optimus Cache Prime, Backup

▸ Dockerized!

▸ Data stored through volume mount

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!

RANDOM DOCKER

ANALYTICS SCRIPTS

▸ People do reporting, etc.

▸ Not necessarily developers

▸ Dockerized!

RANDOM DOCKER

WORDPRESS PLUGIN

▸ Wordpress Plugin to integrate Usersnap

▸ Dockerized!

▸ MySQL, Wordpress stock images

▸ Plugin is linked into plugin folder

RANDOM DOCKER

BUILDING OUR HOMEPAGE

▸ Static page build with Hugo

▸ Again: Not only developers make changes

▸ Dockerized!

RANDOM DOCKER

RESISTANCE IS FUTILE!

LESSONS LEARNED

DEVELOPMENT ENVIRONMENT IS A VERY GOOD START.

LESSONS LEARNED

ALWAYS USE DOCKER-COMPOSE!

LESSONS LEARNED

USE DOCKER VOLUMES TO LINK FILES AND PERSIST DATA.

LESSONS LEARNED

BASH (OR WHATEVER INTERACTIVE COMMAND) INTO A RUNNING CONTAINER

LESSONS LEARNED

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

LESSONS LEARNED

MAC AND WINDOWS: MEH.

LESSONS LEARNED

(OR IS IT?)

THANKS!MARTIN SEREINIG TWITTER: @SRECNIG EMAIL: MS@USERSNAP.COM

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