51
DOCKER’S NOT JUST FOR PRODUCTION Using containers for your development environment Charles Korn

DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

DOCKER’S NOT JUST FOR PRODUCTIONUsing containers for your development environment Charles Korn

Page 2: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 3: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

MegaBank, Inc.

Page 4: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Postgres database

Exchange rate service

Page 5: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Development environment

Page 6: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

THE STATUS QUO

Page 7: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 8: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 9: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Data store

Exchange rate service

Data store

Kafka

CAD

CHF

EUR

GBP

SEK

USD

AUD

Page 10: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

WHAT’S WRONG WITH THE STATUS QUO?

Page 11: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Build environments

Page 12: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

(In)consistency

Page 13: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Onboarding time

Page 14: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Making changes is hard

Page 15: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Overhead

Page 16: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

No isolation

Page 17: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Reproducibility of builds

Page 18: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Team autonomy(or lack thereof)

Page 19: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Test environments

Page 20: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

It’s painful

Page 21: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Data store

Exchange rate service

Data store

Kafka

CAD

CHF

EUR

GBP

SEK

USD

AUD

Page 22: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

It’s painful…which leads to further pain

Page 23: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 24: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

THE IDEA

Page 25: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Build environment

Page 26: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Your computer or a CI agent Build container

Build tools

Libraries

JVM / Ruby / Python

Code directoryCode directory

IDE / text editor

Version control tool

Page 27: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Consistency

Page 28: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Lightweight

Page 29: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Ephemeral

Page 30: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

…which makes caching impossible

Page 31: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Quick onboarding time

Page 32: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Easy to make changes

Page 33: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

docker build \ --tag cool-app-dev-env:v3 \ dev-env

docker run --rm -it -v $PWD:/code -w /code \ cool-app-dev-env:v3 \ ./gradlew build

Page 34: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

FROM alpine:3.5

# ncurses is required for Gradle's prettier console # output mode RUN apk add --update --no-cache \

openjdk8=8.121.13-r0 \ ncurses5-libs=5.9-r1 \ ncurses-terminfo=6.0-r7

Page 35: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

DEMO

Page 36: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Test environment

Page 37: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Postgres database

Exchange rate service

Page 38: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Postgres database

Exchange rate service

Page 39: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

International transfers service

Postgres database

Exchange rate service

Test driver

Page 40: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

docker-compose

Page 41: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

DEMO

Page 42: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

Don’t need to use Docker in production

Page 43: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 44: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

BUT…

Page 45: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

IDE integration

Page 46: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 47: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 48: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 49: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight
Page 50: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

QUESTIONS?

Page 51: DOCKER’S NOT JUST FOR PRODUCTION - Charles … for development...JVM / Ruby / Python Code directory Code directory IDE / text editor Version control tool Consistency Lightweight

charleskorn.com

github.com/charleskorn/docker-dev-env

THANK YOU