Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Docker: multi-stage multi-environment
Search
Abdala Cerqueira
August 31, 2018
Technology
390
0
Share
Docker: multi-stage multi-environment
Talk given on Unconference Track in LaraconEU 2018
Abdala Cerqueira
August 31, 2018
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
3
700
Programação também é mágica
abdala
0
170
Websockets e você, tudo a ver
abdala
1
130
PHP em todos os lugares
abdala
1
140
Automatizado rotinas com sua linguagem favorita
abdala
0
100
PHPUnit, ele irá te salvar!
abdala
0
96
Presente! Software Livre
abdala
0
77
Other Decks in Technology
See All in Technology
基盤を育てる 外部SaaS連携の運用
gamonges_dresscode
1
120
巨大プラットフォームを進化させる「第3のROI」
recruitengineers
PRO
2
1.2k
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
400
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
770
No Types Needed, Just Callable Method Check
dak2
1
1.9k
ハーネスエンジニアリングをやりすぎた話 ~そのハーネスは解体された~
gotalab555
5
1.8k
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
480
EMから幅を広げるために最近挑戦していること / Recent challenges I'm undertaking to expand my horizons beyond EM
hiro_torii
1
130
20260423_執筆の工夫と裏側 技術書の企画から刊行まで / From the planning to the publication of technical book
nash_efp
3
450
小説執筆のハーネスエンジニアリング
yoshitetsu
0
780
AWS DevOps Agentはチームメイトになれるのか?/ Can AWS DevOps Agent become a teammate
kinunori
6
770
20260428_Product Management Summit_tadokoroyoshiro
tadokoro_yoshiro
14
14k
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
220
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
BBQ
matthewcrist
89
10k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Side Projects
sachag
455
43k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
220
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
GraphQLとの向き合い方2022年版
quramy
50
15k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
260
The Limits of Empathy - UXLibs8
cassininazir
1
310
Transcript
Docker: Multi-stage multi-environment Abdala Cerqueira
Dockerfile
FROM COPY --from= docker build --target
Problems
Problem 1 • Keep different Dockerfiles per environment • !
dev tools and dependencies on production
Problem 2 • Big, huge, immense images • One or
two commands may leave images out of control
Dependencies
Checklist • Have only one Dockerfile • Use the same
Dockerfile for all environments (dev, test, prod) • Create small images • Manage less dependencies
Official PHP image • One Dockerfile • All environments •
Small images • Less dependencies Time: ~39s Size: 430MB Security problems
Multi-stage
Official PHP image multi-stage • One Dockerfile • All environments
• Small images • Less dependencies Time: ~40s Size: 393MB Not that small, hidden dependencies
Alpine image • One Dockerfile • All environments • Small
images • Less dependencies Time: ~11s Size: 59.4MB Still have unwanted dependencies
Alpine image multi-stage • One Dockerfile • All environments •
Small images • Less dependencies Time: ~16s Size: 35.8MB This is ART <3
Comparison table Image Time Size alpine:3.8 - 4.41 MB php:7.2-apache
- 377 MB laravel-apache 39s 430 MB laravel-apache-multi 40s 393 MB laravel-alpine 11s 59.4 MB laravel-alpine-multi 16s 35.8 MB
Conclusion • Care about dependencies • Try different techniques
Thanks!