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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
710
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
AgentCore Managed Harness を使ってみよう
yakumo
2
290
The 7 pitfalls of AI
ufried
0
160
Digital Independence: Why, When and How
wannesrams
0
220
AIが盛んな時代に 技術記事を書き始めて起きた私の中での小さな変化
peintangos
0
340
20年前の「OSS革命」に学ぶ AI時代の生存戦略
samakada
0
520
アクセシビリティはすべての人のもの
tomokusaba
0
210
雑談は、センサーだった
bitkey
PRO
0
140
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
1.6k
Modernizing Your HCL Connections Experience: Visual Report to chain, Profile Enhancements, and AI Integration
wannesrams
0
240
Scovilleモバイルエンジニア募集中.pdf
julienrudin
0
140
エージェントスキルを作って自分のインプットに役立てよう
tsubakimoto_s
0
500
音声言語モデル手法に関する発表の紹介
kzinmr
0
150
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
350
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
sira's awesome portfolio website redesign presentation
elsirapls
0
230
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
220
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
How to build a perfect <img>
jonoalderson
1
5.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
240
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
530
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
130
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!