docker for dev

45
Docker for development Why and how to use docker for development Nelis Boucké +32 486 76 12 71 @nelisboucke in/nelis Erik Talboom +32 498 43 29 67 @talboomerik in/talboomerik

Upload: erik-talboom

Post on 15-Apr-2017

102 views

Category:

Technology


0 download

TRANSCRIPT

Docker for developmentWhy and how to use docker for development

Nelis Boucké

+32 486 76 12 71

@nelisboucke

in/nelis

Erik Talboom

+32 498 43 29 67

@talboomerik

in/talboomerik

Dev, no ops!

First we show, then you do

Content

● Why a session on docker?● What is docker?● Usage during development?● What did we discover?

SHOW, DON’T TELL

Demo 1: Develop a website

Demo: Develop a website

Goal: use docker during development of a website

a. Html, php, javascriptb. Use volume to share website content between host and docker

What is docker?

“Docker - build, ship and run any app. Anywhere”

“Docker is a platform for developing, shipping and running applications using container virtualization technology”

“Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.”

What is docker?“Docker - build, ship and run any app. Anywhere”

“Docker is a platform for developing, shipping and running applications using container virtualization technology”

“Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.”

What is docker?“Docker - build, ship and run any app. Anywhere”

“Docker is a platform for developing, shipping and running applications using container virtualization technology”

“Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.”

Virtual machines vs Containers

Containers are like onions

Containers share

What are the different components?Docker engine

Docker hub

Docker machine

Docker swarm

Docker compose

Kitematic

What does it mean for development?

● Lightweight● Simple test environment ● One person makes it work

○ All external packages included!

● Different version in parallel

Demo 2: Multiple servers

Demo: Java Spring bootstrap

Goal: use docker during development of a java application

a. Databaseb. Building and package your app in docker

What are the different components?Docker engine

Docker hub

Docker machine

Docker swarm

Docker compose

Kitematic

Demo: Microservices

Goal: setup a scalable microservice app

https://github.com/docker/example-voting-app

Imagine…

Imagine: architecture landscape

CRM Billing Finance

Angular app

Market appBPM ServiceMix

Identity

MySql Postgres

Reverse proxy Admin access gatewaySquid

SFTP server

Imagine: scenario to onboard a customer

CRM Billing Finance

Angular app

Market appBPM ServiceMix

Identity

MySql Postgres

Reverse proxy Admin access gatewaySquid

SFTP server

● Lightweight!● Easy test environment with multiple servers!● Real ‘container’

Difference with Vagrant?

● External packages encapsulated (build time of Docker)● Less resources

What does it mean for development?

Artifacts

What are the different components?Docker engine

Docker hub

Docker machine

Docker swarm

Docker compose

Kitematic

Demo 3: CI

Imagine…

Imagine: lots of people...

Demo: Per branch testing

Goal: simplify testing for each branch

What does it mean for development?

● Isolated environments for focused testing● Fast end users testing and feedback!● No need to run complex environment locally

Demo 4: AWS

Demo: AWS swarm

● Transparent app over a set of nodes● Scale● Update a node

What are the different components?Docker engine

Docker hub

Docker machine

Docker swarm

Docker compose

Kitematic

What does this mean for development?

● Enables mixed technologies● Plays really well with microservices● Higher flexibility

○ Deployment options○ Scaling○ Updates

→ More fundamental shift then some people realise

Data storage

Docker volumes

“A volume is a designated directory in a container, which is designed to persist data, independent of the container’s lifecycle”

+ Volume changes are excluded when updating an image+ Persist when a container is deleted+ Can be mapped to a host folder+ Can be shared between containers

How to use volumes?

What to use volumes for?

Closing remarks

● Reproducible and reliable● Easy and fast to build, test, release● Potentially shippable product focus

Underlying principles

How to solve this?

Challenges introducing docker

● Learning curve for your developers and ops team.○ You really need some Ops knowledge to set this up.

● Not everything is easy to dockerize well (e.g. Jenkins)● Docker for dev != Docker in production● Docker environment is fast changing, and comes with a whole new set of tools● Docker stability in production (disk drivers, network setup, connection with

Kernel)● Docker security?

What’s next?

Dev + ops!

Thank youNelis Boucke

+32 486 76 12 71

@nelisboucke

in/nelis

Erik Talboom

+32 498 43 29 67

@talboomerik

in/talboomerik

http://urls.colearn.be/2fYkokI