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
650
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
96
PHPUnit, ele irá te salvar!
abdala
0
87
Presente! Software Livre
abdala
0
70
Other Decks in Technology
See All in Technology
小規模チームによる衛星管制システムの開発とスケーラビリティの実現
sankichi92
0
150
Excelデータ分析で学ぶディメンショナルモデリング ~アジャイルデータモデリングへ向けて~ by @Kazaneya_PR / 20251126
kazaneya
PRO
3
620
Digital omtanke på Internetdagarna 2025
axbom
PRO
0
140
Pandocでmd→pptx便利すぎワロタwww
meow_noisy
2
1k
国産クラウドを支える設計とチームの変遷 “技術・組織・ミッション”
kazeburo
6
10k
GitHub を組織的に使いこなすために ソニーが実践した全社展開のプラクティス
sony
13
7k
Bedrock のコスト監視設計
fohte
2
250
レガシーで硬直したテーブル設計から変更容易で柔軟なテーブル設計にする
red_frasco
4
640
IaC を使いたくないけどポリシー管理をどうにかしたい
kazzpapa3
1
180
都市スケールAR制作で気をつけること
segur
0
210
Dify on AWS の選択肢
ysekiy
0
110
TypeScript 6.0で非推奨化されるオプションたち
uhyo
15
5.5k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
60
9.6k
Context Engineering - Making Every Token Count
addyosmani
9
430
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
The Language of Interfaces
destraynor
162
25k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.2k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
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!