Docker from a team perspective

19
Docker from a team perspective Edwin Vlieg - MoneyBird

Transcript of Docker from a team perspective

Page 1: Docker from a team perspective

Docker from a team perspective

Edwin Vlieg - MoneyBird

Page 2: Docker from a team perspective

Ruby Postgres

OSX

UnicornProject

Page 3: Docker from a team perspective

Ruby Postgres

OSX

Ruby Postgres

OSX

Ruby Postgres

Linux

UnicornProject UnicornProject UnicornProject

Page 4: Docker from a team perspective

Ruby Postgres

OSX

Ruby Postgres

OSX

Ruby Postgres

Linux

UnicornProject UnicornProject UnicornProject

We need GraphicsMagick

Page 5: Docker from a team perspective

Ruby Postgres

OSX

Ruby Postgres

OSX

Ruby Postgres

Linux

UnicornProject UnicornProject UnicornProject

You need GraphicsMagick!

GM

Page 6: Docker from a team perspective

OSX

Ruby Postgres

OSX Linux

UnicornProject UnicornProject UnicornProject

You need GraphicsMagick!

GMRuby Postgres GM Ruby Postgres GM

30 minutes 15 minutes

Page 7: Docker from a team perspective

Development

• Always changing dependencies in projects

• Keeping up with changes takes away productivity

• Differences as small as a different patch level or different compile time argument can mean hours of debugging.

Page 8: Docker from a team perspective

After development

• Continuous Integration

• Staging environment

• Production environment

Page 9: Docker from a team perspective

Ruby 2.1 Postgres

OS

UnicornProject

Ruby 2.0 Redis

Memcache

ElasticSearch

StorageProject

Ruby 2.1 Postgres GM

GhostScript

PrinceXML

Page 10: Docker from a team perspective

We tried

• Automated provisioning of environments

• Vagrant boxes with dependencies

Page 11: Docker from a team perspective

OSX

Ruby Postgres

OSX Linux

UnicornProject UnicornProject UnicornProject

GMRuby Postgres GM Ruby Postgres GM

Image

Page 12: Docker from a team perspective

Image

“A Docker image is a read-only template.”

Page 13: Docker from a team perspective

StorageProject

Ingredients Ubuntu OpenSSL Ruby Bundler GraphicsMagick PrinceXML Source code

ImageStorageProject

DockerfileFROM ubuntuRUN apt-get install opensslRUN apt-get install rubyRUN gem install bundlerRUN apt-get install gmRUN princexml/install.shADD ./src/storage_project

Page 14: Docker from a team perspective

Image

• Create image from Dockerfile

• Run image to create a container running the dependencies and source code

• Result is the same on every host computer able to run a Docker host (Linux).

Page 15: Docker from a team perspective

Ruby Postgres

OSX

Ruby Postgres

OSX

Ruby Postgres

Linux

UnicornProject UnicornProject UnicornProject

ADD apt-get install gm

Page 16: Docker from a team perspective

OSX

Ruby Postgres

OSX Linux

UnicornProject UnicornProject UnicornProject

Pull new image!

GMRuby Postgres GM Ruby Postgres GM

30 seconds 30 seconds

Page 17: Docker from a team perspective

Docker vs VMs

AppA

Hypervisor (Type 2)

Host OS

Server

GuestOS

Bins/Libs

AppA’

GuestOS

Bins/Libs

AppB

GuestOS

Bins/Libs

VM

GuestOS

GuestOS

App A

Docker

Host OS

Server

App A

Bins/Libs

App B

App B

App B

App BContainer

Bins/Libs

Page 18: Docker from a team perspective

Backing services

• We try to serve only 1 service in an image

• Backing services like Postgres, Redis, ElasticSearch, Memcached have their own images

Page 19: Docker from a team perspective

Conclusion

• Docker makes dependency management and cooperation on projects way easier!

• Less downtime during development and in production due to clear definition of required environment.