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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
730
Programação também é mágica
abdala
0
170
Websockets e você, tudo a ver
abdala
1
140
PHP em todos os lugares
abdala
1
150
Automatizado rotinas com sua linguagem favorita
abdala
0
110
PHPUnit, ele irá te salvar!
abdala
0
100
Presente! Software Livre
abdala
0
82
Other Decks in Technology
See All in Technology
Terraform共通モジュールをチーム横断で“変えられる”運用へ ― リリースと適用の分離
kekke_n
1
2.9k
[2026-07-15] AI Ready なはずだったアーキテクチャと、見えてきた課題・次に目指す状態
wxyzzz
4
2.7k
SRE Lounge Hiroshimaへの招待
grimoh
0
640
AI時代の EM への処方箋
staka121
PRO
0
130
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
1
240
プロダクトだけじゃない、社内プロセスにおける自動化・省力化ノススメ
kakehashi
PRO
1
3.6k
Making sense of Google’s agentic dev tools
glaforge
1
190
Zoom2Youtube.Claude
kawaguti
PRO
3
490
Claude Code公式skillで 自分の仕事を少しずつ手放そう!(Claude Code開発ノウハウ大公開スペシャル by クラスメソッド)
kaym
1
280
環境凍結という Toil を倒す -セルフサービス型 Ephemeral テスト環境の 設計と実践
shirouz
1
2.3k
事業価値を⽣み出すSREへ SREが担うべき意思決定の5層
kenta_hi
2
3.5k
CIで使うClaude
iwatatomoya
0
240
Featured
See All Featured
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
650
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
260
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Odyssey Design
rkendrick25
PRO
2
730
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
Testing 201, or: Great Expectations
jmmastey
46
8.2k
GraphQLとの向き合い方2022年版
quramy
50
15k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
870
Navigating Weather and Climate Data
rabernat
0
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!