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
4
620
Programação também é mágica
abdala
0
150
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
80
Presente! Software Livre
abdala
0
64
Other Decks in Technology
See All in Technology
積み上げられた技術資産と向き合いながら、プロダクトの信頼性をどう守るか
plaidtech
PRO
0
1k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.2k
不安定だったテストが信頼を取り戻すまで / The Road to Trustworthy Tests
katawara
0
110
Java 30周年記念! Javaの30年をふりかえる
skrb
4
2.3k
入門 ESlint Typegen #TSKaigi #TSKaigi2025_kataritai
bengo4com
0
1.9k
金融システムをモダナイズするためのAmazon Elastic Kubernetes Service(EKS)ノウハウ大全
daitak
0
140
AIエージェント実践集中コース LT
okaru
1
150
障害を回避するHttpClient再入門 / Avoiding Failures HttpClient Reintroduction
uskey512
1
340
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
12k
大規模PaaSにおける監視基盤の構築と効率化の道のり
lycorptech_jp
PRO
0
190
GoogleのAI Agent
shukob
0
180
OpenJDKエコシステムと開発中の機能を紹介 2025夏版
chiroito
1
970
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Documentation Writing (for coders)
carmenintech
71
4.8k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
Optimizing for Happiness
mojombo
378
70k
Speed Design
sergeychernyshev
30
970
Fontdeck: Realign not Redesign
paulrobertlloyd
84
5.5k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Producing Creativity
orderedlist
PRO
346
40k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.4k
Practical Orchestrator
shlominoach
188
11k
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!