The Twelve-Factor Container
1 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 2
Slide 2 text
A word about consent…
Please do:
Take pictures, tweet, take notes.
Please don't:
Record or live stream without my explicit consent.
2 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 3
Slide 3 text
The Twelve-Factor Container
• Twitter @caseywest
• Email casey@geeknest.com
• Web http://caseywest.com
3 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Anti-pattern
Local disk
27 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 28
Slide 28 text
Anti-pattern
Local disk
28 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 29
Slide 29 text
Anti-pattern
Local disk
29 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 30
Slide 30 text
Best Practice
Connect to network-
attached services using
connection info from
the environment
30 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 31
Slide 31 text
5: Strictly separate
build and run stages
31 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice
Build immutable
images then run those
images
33 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 34
Slide 34 text
Painfully Obvious Best Practices
1. Eat when hungry
2. Sleep when tired
3. Book Casey West for speaking gigs
34 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 35
Slide 35 text
Best Practice
Respect the lifecycle:
buid, run, destroy
35 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 36
Slide 36 text
6: Execute the app as
one or more stateless
processes
36 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 37
Slide 37 text
Best Practice
Schedule LRPs by
distributing them
across a cluster of
physical hardware
37 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Best Practice
Reuse application
images with specific
entrypoints for tasks
55 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 56
Slide 56 text
More factors?
• API first
• Secrets management
• Health metrics
• Global distribution
56 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Slide 57
Slide 57 text
You are now cloud-native
57 ! @caseywest #abstractions #containers #realworld #sorrynotsorry
Bargaining
What if we create "microservices"
that all talk to the same data source?
78 ! @caseywest #abstractions #containers #realworld #sorrynotsorry