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
380
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
700
Programação também é mágica
abdala
0
160
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
93
Presente! Software Livre
abdala
0
75
Other Decks in Technology
See All in Technology
Claude Codeと駆け抜ける 情報収集と実践録
sontixyou
2
1.2k
Snowflakeデータ基盤で挑むAI活用 〜4年間のDataOpsの基礎をもとに〜
kaz3284
1
290
【PyCon mini Shizuoka 2026】生成AI時代に画像処理やオーディオ処理のノードエディターを作る理由
kazuhitotakahashi
0
200
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
43k
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
140
技術キャッチアップ効率化を実現する記事推薦システムの構築
yudai00
2
160
チームメンバー迷わないIaC設計
hayama17
5
3.2k
Serverless Agent Architecture on Azure / serverless-agent-on-azure
miyake
1
110
AIエンジニア Devin と歩む、自律型運用プロセスの構築
a2ito
0
370
opsmethod第1回_アラート調査の自動化にむけて
yamatook
0
330
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
14k
ヘルシーSRE
tk3fftk
2
190
Featured
See All Featured
Building Adaptive Systems
keathley
44
2.9k
GraphQLの誤解/rethinking-graphql
sonatard
75
11k
How to build a perfect <img>
jonoalderson
1
5.2k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building the Perfect Custom Keyboard
takai
2
700
The SEO Collaboration Effect
kristinabergwall1
0
380
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Claude Code のすすめ
schroneko
67
220k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Crafting Experiences
bethany
1
74
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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!