docker’ized microservices - inovex gmbh · docker’ized microservices 18.12.2014 ... vagrant...

24
Docker’ized Microservices 18.12.2014 Hendrik Still

Upload: vuonghuong

Post on 13-Jan-2019

239 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Docker’ized Microservices

18.12.2014Hendrik Still

Page 2: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

‣ Microservices‣ What are Microservices?‣ Why Microservices?‣ Microservices, the Silver Bullet?

‣ Dockerizing Microservices‣ @ Development‣ @ Continuous Delivery

Agenda

Page 3: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Source: http://martinfowler.com/articles/microservices.html#CharacteristicsOfAMicroserviceArchitecture

What are Microservices?

“In short, the microservice architectural style is an approach to developing a single

application as a suite of small services, each running in its own process and

communicating with lightweight mechanisms, often an HTTP resource API.“

-James Lewis & Martin Fowler

Page 4: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

BuyLike

The Monolith

01010101101011101001

$

Page 5: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

BuyLike

$

Splitting up the Monolith

Page 6: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Why Microservices?

Page 7: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Buy

$

Like

Buy Service

Like Service

Scalability!

Page 8: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Buy

$

Like

Fault-tolerance!

Page 9: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Buy

$

Like

Polyglot DevelopmentUse the right tool for the job!

Page 10: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Are Microservicesthe Silver Bullet?

Page 11: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Imagesource: http://thefilmstage.com/news/tommy-lee-jones-to-produce-write-direct-and-star-in-the-homesman/

Are you serious?

Page 12: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Microservices Architecture =

Distributed System

Page 13: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Runtime

Overhead!

01010101101011101001

$

Runtime

Runtime

Runtime

$

vs.

Page 14: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Microservices & Docker

Page 15: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

BuyLike

$

Docker

Page 16: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

The Dockerfile

$ sudo docker build -t product-service .

$ sudo docker run -d --name=product-service -p 9001:9001 --link="eureka-master:eureka-master" product-service

FROM dockerfile/java:oracle-java7

ADD build/libs/product-service.jar /service/product-service.jar

WORKDIR /service

EXPOSE 9001EXPOSE 7979

CMD java -jar /service/product-service.jar

Page 17: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

@ Development

Buy

$

Like

$ docker build -t product-service .$ docker run … product-service

$ docker build -t like-service .$ docker run … like-service

$ docker build -t pay-service .$ docker run … pay-service

$ docker build -t sun-service .$ docker run … sun-service

$ docker build -t arrow-service .$ docker run … arrow-service

Page 18: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Orchestration tools

Page 19: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Vagrant

Vagrant.configure(“2”) do |config| config.vm.define "productservice" do |ms| ms.vm.provider "docker" do |d| d.build_dir = "./product-service/" d.ports = ["9001:9001","7979:7979"] d.link "eureka-master:eureka-master" d.has_ssh = false end end

config.vm.define "productpriceservice" do |ms| ms.vm.provider "docker" do |d| d.build_dir = "./product-price-service/" d.link "eureka-master:eureka-master" d.has_ssh = false end end# Other Microservices end

Page 20: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

@ Development

Buy

$

Like$ vagrant up --provider=docker

Page 21: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

@ Continuous Delivery

Commit stage

Acceptance test stageVCS ...

Releasestage

Acceptance test stage ...

Releasestage

Commit stageVCS

Artifact Repository

Page 22: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Contact

Hendrik Still

[email protected]

inovex GmbHOffice KarlsruheLudwig-Erhard-Allee 676131 Karlsruhe

Thank you for listening!

Page 23: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Image Sources

● Spotify Logo https://developer.spotify.com/download/guidelines/ux-with-other-brands.pdf Docker Logo http://commons.wikimedia.org/wiki/File:Docker_%28container_engine%29_logo.png

● Java Logo https://en.wikipedia.org/wiki/Java_%28programming_language%29#mediaviewer/File:Java_logo_and_wordmark.svg

● Ruby Logo https://commons.wikimedia.org/wiki/File:Ruby_logo.svg● Mysql Logo https://en.wikipedia.org/wiki/MySQL#mediaviewer/File:MySQL.svg ● MongoDB https://en.wikipedia.org/wiki/MongoDB#mediaviewer/File:MongoDB_Logo.png● Vagrant https://commons.wikimedia.org/wiki/File:Vagrant.png#mediaviewer/File:Vagrant.png● Rambo Tux http://it-runde.de/838/kleine-tux-gallerie-avatare

Page 24: Docker’ized Microservices - inovex GmbH · Docker’ized Microservices 18.12.2014 ... Vagrant Vagrant.configure ... $ vagrant up --provider=docker @ Continuous Delivery Commit stage

Buch: http://shop.oreilly.com/product/0636920033158.doVideo: http://vimeo.com/74589816

Recommendations