Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

63
A STORY CONTAINER AND MICROSERVICES:

Transcript of Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

Page 1: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

A ❤ STORYCONTAINER AND MICROSERVICES:

Page 2: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

👋 I’M THOMAS

NICE TO MEET YOU!

Page 3: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 4: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

WHAT ABOUT THIS

❤ STORY ?

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 5: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

💼 MY FIRST WORK DAY

Page 6: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 7: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

MICROSERVICE’S PROS

▸ Relatively small

▸ Improve fault isolation

▸ Develop & deploy independently

▸ Improves tuning & scaling

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 8: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

🏃 MY SECOND WORK DAY

Page 9: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

IT WAS NOT SO GOOD

Page 10: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 11: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 12: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

▸ Additional complexity of a distributed system

▸ Testing is more complex

▸ Internal process for communication purpose

▸ A bad APIs design it’s very dangerous

▸ Development environment it’s hard to setup

CONTAINER AND MICROSERVICES: A ❤ STORY

MICROSERVICE’S CONS

Page 13: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

Development environment it’s

hard to setup 😤

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 14: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 15: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

OUR MICROSERVICES TECHNOLOGY/TOOLS

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 16: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

3 days * 2 people =

6 days!⬇

🗑

Page 17: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Context

&

Page 18: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

( )

Page 19: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

x days * y people =

z days!

Page 20: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

🤔

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 21: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Simulates isolate systems

Usable in more OS

Ready to use

Easy to install

Easy to use

🤔

Page 22: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

💡

Page 23: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

💡

Page 24: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

🤓

Page 25: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Simulate isolate systems

Usable in more OS

Ready to use

Easy to install

Easy to use

🤔

Page 26: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER FOR MAC/WINDOWS

Docker for Mac/Windows is an easy-to-install desktop app for building, debugging and testing

Dockerized apps on a Mac/PC. 

😎

Page 27: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Docker platform

Docker compose

Docker CLI

Docker Notary CLI

Page 28: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Docker platform

Docker compose Docker CLI

Docker Notary CLI

Page 29: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Simulate isolate systems

Usable in more OS

Ready to use

Easy to install

Easy to use

🤔

Page 30: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 31: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DEMO TIME

(

Page 32: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DEMO FILES

•Dockerfile

•docker-compose.yml

Page 33: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

Page 34: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

DOCKER IMAGE

Page 35: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

FROM ruby RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails

File: ./my_app/Dockerfile

Page 36: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

FROM ruby RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails

File: ./my_app/Dockerfile

Page 37: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

https://hub.docker.com/

Page 38: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

FROM ruby RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails

File: ./my_app/Dockerfile

Page 39: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

FROM ruby RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails

File: ./my_app/Dockerfile

Page 40: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER IMAGE

FROM ruby RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails

File: ./my_app/Dockerfile

Page 41: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 42: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

DOCKER COMPOSE

Page 43: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 44: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 45: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 46: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 47: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 48: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 49: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 50: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 51: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

version: '3' services: web: build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres

DOCKER COMPOSEFile: ./docker-compose.yml

Page 52: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

( )

WEB DB WEB DB

Page 53: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

0.25 days * 2 people =

0.5 day!

Page 54: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 55: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

IT’S TIME TO SAY GOODBYE 😢

Page 56: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

BUT FIRST…

Page 57: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

▸ Microservices

▸ Docker compose

▸ How portable and repeatable development environment save your time!

…WHAT HAVE WE SEEN TODAY?

Page 58: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

CONTAINER AND MICROSERVICES: A ❤ STORY

SO, WHY I’M IN ❤?▸ Microservices architecture gave me a new point

of view

▸ Thanks to microservices, I found a way to use and understand containers

▸ Life is too short for waste your time

Page 59: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

“YOUR WORK IS GOING TO FILL A LARGE PART OF YOUR LIFE, AND THE ONLY WAY TO BE TRULY SATISFIED IS TO DO WHAT YOU BELIEVE IS GREAT WORK. AND THE ONLY WAY TO DO GREAT WORK IS TO LOVE WHAT YOU DO.” STEVE JOBS

CONTAINER AND MICROSERVICES: A ❤ STORY

Page 60: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

🙏 THANK YOU!

Page 61: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

🙋1 QUESTIONS?

Page 62: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

@Rosse91

Software developer @ Seesaw

Coordinator of Programmers in Padua

community

Page 63: Thomas Rossetto - Container and microservices: a love story - Codemotion Milan 2017

👋 THANKS FOR

COMING HAVE A NICE DAY

SEE YOU AROUND!