Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
The DShell Pattern (DevOpsDays London 2019)
David McKay
September 27, 2019
Technology
0
100
The DShell Pattern (DevOpsDays London 2019)
David McKay
September 27, 2019
Tweet
Share
More Decks by David McKay
See All by David McKay
rawkode
0
110
rawkode
0
18
rawkode
0
84
rawkode
0
120
rawkode
0
62
rawkode
0
50
rawkode
0
33
rawkode
0
69
rawkode
2
180
Other Decks in Technology
See All in Technology
raykataoka
9
7.6k
torisoup
10
4.9k
karabish
0
170
clustervr
0
210
eayedi
1
110
tomihisa
1
1.1k
ihcomega56
1
420
karamem0
1
660
pohjus
0
3.3k
cfisch3r
1
310
miura55
0
240
yoshiori
1
1.1k
Featured
See All Featured
chriscoyier
684
180k
scottboms
251
11k
stephaniewalter
260
11k
addyosmani
311
21k
brad_frost
157
6.4k
lauravandoore
437
28k
samanthasiow
56
6.3k
bkeepers
321
53k
pauljervisheath
196
15k
orderedlist
PRO
328
36k
shlominoach
176
7.5k
cromwellryan
103
6.1k
Transcript
The DShell Pattern DevOps Days London, 2019
David McKay ➔ Developer Advocate for InfluxData ➔ Kubernetes Release
Team ➔ Tweets @rawkode ★ Scottish ★ Lover of esoteric programming languages ★ Likes symmetry
BREAKING NEWS Some* developers don’t want to use Docker *
No developer with macOS wants to use Docker
Docker is useful Encapsulated Dependencies Documented Build Process Deployable
3 Components Dockerfile Docker Compose Makefile
Dockerfile Make it work for all environments
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 … ...
Docker Compose Make it as (more) painful as possible (than
normal)
dshell dshell: @docker-compose run \ --rm \ --service-ports \ --user
$UID \ --use-aliases \ --entrypoint=ash \ myapp
Encourage DShell Block Up service: myapp: entrypoint: sh command: echo
Publish Service Ports --service-ports Override Entrypoint --entrypoint=ash
UNPOPULAR OPINION DO NOT use compose syntax v3 in dev
Best Practice Use Depends On depends_on: mongodb: condition: service_healthy 12-Factor
env_file: .env env_file: - .env - .env.secret
Makefile Unify Developers
The Sausage .PHONY: dshell dclean up up: deps @mix run
--no-halt compile: deps @mix compile
up up: @npm run develop @mix test @FLASK_APP=hello flask run
dclean! dclean: @docker-compose down --rmi=local -v
Final API ❏ make dshell [host] ❏ make up [container]
❏ make test | deps | whatever [container] ❏ make dclean [host]
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.
VSCode Remotes { "dockerComposeFile": [ "../docker-compose.yml", ], "service": "node", }
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