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
0
370
Docker: multi-stage multi-environment
Talk given on Unconference Track in LaraconEU 2018
Abdala Cerqueira
August 31, 2018
Tweet
Share
More Decks by Abdala Cerqueira
See All by Abdala Cerqueira
Docker: multi-stage and multi-environment
abdala
3
640
Programação também é mágica
abdala
0
160
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
130
Automatizado rotinas com sua linguagem favorita
abdala
0
93
PHPUnit, ele irá te salvar!
abdala
0
81
Presente! Software Livre
abdala
0
68
Other Decks in Technology
See All in Technology
Claude Code x Androidアプリ 開発
kgmyshin
1
380
アカデミーキャンプ 2025 SuuuuuuMMeR「燃えろ!!ロボコン」 / Academy Camp 2025 SuuuuuuMMeR "Burn the Spirit, Robocon!!" DAY 1
ks91
PRO
0
150
第64回コンピュータビジョン勉強会@関東(後編)
tsukamotokenji
0
150
MySQL HeatWave:サービス概要のご紹介
oracle4engineer
PRO
4
1.6k
AIに頼りすぎない新人育成術
cuebic9bic
3
340
プロダクトエンジニアリングで開発の楽しさを拡張する話
barometrica
0
220
LLM 機能を支える Langfuse / ClickHouse のサーバレス化
yuu26
9
2.7k
PFEM Online Feature Flag @ newmo
shinyaishitobi
2
180
LLM時代の検索とコンテキストエンジニアリング
shibuiwilliam
2
910
Backlog AI アシスタントが切り開く未来
vvatanabe
1
170
プロジェクトマネジメントは不確実性との対話だ
hisashiwatanabe
0
170
AIドリブンのソフトウェア開発 - うまいやり方とまずいやり方
okdt
PRO
8
290
Featured
See All Featured
Building Adaptive Systems
keathley
43
2.7k
Bash Introduction
62gerente
614
210k
How to Ace a Technical Interview
jacobian
279
23k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Faster Mobile Websites
deanohume
309
31k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
For a Future-Friendly Web
brad_frost
179
9.9k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Why Our Code Smells
bkeepers
PRO
338
57k
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!