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
300
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
520
Programação também é mágica
abdala
0
140
Websockets e você, tudo a ver
abdala
1
110
PHP em todos os lugares
abdala
1
110
Automatizado rotinas com sua linguagem favorita
abdala
0
79
PHPUnit, ele irá te salvar!
abdala
0
71
Presente! Software Livre
abdala
0
51
Other Decks in Technology
See All in Technology
Vertex AI を中心に 生成AIのアップデートを共有します
kaz1437
0
300
APIファーストなプロダクトマネジメントの実践 〜SaaSus Platformでの例〜 / "Practicing API-First Product Management - An Example with SaaSus Platform
oztick139
0
100
生産性向上チームの紹介
cybozuinsideout
PRO
1
870
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
510
On Your Data を超えていく!
hirotomotaguchi
2
670
エンジニア候補者向け資料2024.04.24.pdf
macloud
0
3.3k
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
200
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
Databricks における 『MLOps』
databricksjapan
2
170
プロンプトエンジニアリングでがんばらない-Agentic Workflow へ-近藤憲児
kenjikondobai
0
110
DevOpsDays History and my DevOps story
kawaguti
PRO
9
2.5k
MySQL の SQL クエリチューニングの要所を掴む勉強会
andpad
2
6.2k
Featured
See All Featured
Music & Morning Musume
bryan
41
5.6k
Making the Leap to Tech Lead
cromwellryan
124
8.5k
Documentation Writing (for coders)
carmenintech
60
3.9k
Art, The Web, and Tiny UX
lynnandtonic
289
19k
Code Review Best Practice
trishagee
55
15k
How to Ace a Technical Interview
jacobian
272
22k
The Cult of Friendly URLs
andyhume
74
5.7k
Bash Introduction
62gerente
604
210k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
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!