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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Abdala Cerqueira
August 31, 2018
Technology
0
390
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
94
Presente! Software Livre
abdala
0
77
Other Decks in Technology
See All in Technology
わからなくて良いなら、わからなきゃだめなの?
kotaoue
1
370
システム標準化PMOから ガバメントクラウドCoEへ
techniczna
1
140
エンジニアリングマネージャーの仕事
yuheinakasaka
0
110
ソフトバンク流!プラットフォームエンジニアリング実現へのアプローチ
sbtechnight
1
200
複数クラスタ運用と検索の高度化:ビズリーチにおけるElastic活用事例 / ElasticON Tokyo2026
visional_engineering_and_design
0
170
(Test) ai-meetup slide creation
oikon48
3
460
VLAモデル構築のための AIロボット向け模倣学習キット
kmatsuiugo
0
280
Lambda Web AdapterでLambdaをWEBフレームワーク利用する
sahou909
0
180
AI時代の「本当の」ハイブリッドクラウド — エージェントが実現した、あの頃の夢
ebibibi
0
150
フロントエンド刷新 4年間の軌跡
yotahada3
0
500
WebアクセシビリティをCI/CDで担保する ― axe DevTools × Playwright C#実践ガイド
tomokusaba
2
180
Kiro Powers 入門
k_adachi_01
0
120
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Facilitating Awesome Meetings
lara
57
6.8k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
64
53k
AI: The stuff that nobody shows you
jnunemaker
PRO
3
450
Optimizing for Happiness
mojombo
378
71k
Technical Leadership for Architectural Decision Making
baasie
3
300
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
We Are The Robots
honzajavorek
0
200
Evolving SEO for Evolving Search Engines
ryanjones
0
160
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
160
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!