David McKay ➔
Developer Advocate for InfluxData
★
Scottish
➔
Kubernetes Release Team
★
Lover of esoteric programming languages
➔
Tweets @rawkode
★
Likes symmetry
Slide 3
Some* developers don’t want to use Docker * No developer with macOS wants to use Docker
BREAKING NEWS
Slide 4
Docker is useful Encapsulated Dependencies
Documented Build Process
Deployable
Slide 5
3 Components Dockerfile
Docker Compose
Makefile
Slide 6
Dockerfile Make it work for all environments
Slide 7
Dockerfile FROM elixir:1.9-alpine AS base FROM base AS development RUN apk add —update vim git make FROM base AS build RUN make compile FROM base AS production COPY —from=build … …
Slide 8
Docker Compose Make it as (more) painful as possible (than normal)
Encourage DShell Block Up service: myapp: entrypoint: sh command: echo
Publish Service Ports
Override Entrypoint
—service-ports
—entrypoint=ash
Slide 11
DO NOT use compose syntax v3 in dev
UNPOPULAR OPINION
Slide 12
Best Practice Use Depends On depends_on:
12-Factor env_file: .env
mongodb: condition: service_healthy
env_file: - .env - .env.secret
Slide 13
Makefile Unify Developers
Slide 14
The Sausage .PHONY: dshell dclean up up: deps @mix run —no-halt compile: deps @mix compile
Slide 15
up up: @npm run develop @mix test @FLASK_APP=hello flask run
Slide 16
dclean! dclean: @docker-compose down —rmi=local -v
Slide 17
Final API ❏
make dshell
[host]
❏
make up
[container]
❏
make test | deps | whatever
[container]
❏
make dclean
[host]
Slide 18
Better Together We’re deploying Docker to production (I hope), so encourage (not force) it’s usage for local development; make it easy for people to dip their toe in.
Thank You ➔
Follow me on Twitter (@rawkode)
➔
At the InfluxData booth (I’ve got badges and stickers)
➔
Come speak to me about InfluxDB, Cloud Native, Monitoring, Docker, or Kubernetes