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
330
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
4
590
Programação também é mágica
abdala
0
140
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
120
Automatizado rotinas com sua linguagem favorita
abdala
0
87
PHPUnit, ele irá te salvar!
abdala
0
74
Presente! Software Livre
abdala
0
59
Other Decks in Technology
See All in Technology
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
19
18k
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.8k
ハイテク休憩
sat
PRO
2
170
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
230
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
200
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
210
C++26 エラー性動作
faithandbrave
2
780
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
760
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
150
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Git: the NoSQL Database
bkeepers
PRO
427
64k
BBQ
matthewcrist
85
9.4k
Speed Design
sergeychernyshev
25
670
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
A Tale of Four Properties
chriscoyier
157
23k
The Invisible Side of Design
smashingmag
298
50k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
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!