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
350
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
600
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
90
PHPUnit, ele irá te salvar!
abdala
0
75
Presente! Software Livre
abdala
0
59
Other Decks in Technology
See All in Technology
データ資産をシームレスに伝達するためのイベント駆動型アーキテクチャ
kakehashi
PRO
2
610
【詳説】コンテンツ配信 システムの複数機能 基盤への拡張
hatena
0
110
明日からできる!技術的負債の返済を加速するための実践ガイド~『ホットペッパービューティー』の事例をもとに~
recruitengineers
PRO
3
520
RSNA2024振り返り
nanachi
0
630
開発組織のための セキュアコーディング研修の始め方
flatt_security
3
2.7k
エンジニアのためのドキュメント力基礎講座〜構造化思考から始めよう〜(2025/02/15jbug広島#15発表資料)
yasuoyasuo
18
7.1k
オブザーバビリティの観点でみるAWS / AWS from observability perspective
ymotongpoo
9
1.7k
「海外登壇」という 選択肢を与えるために 〜Gophers EX
logica0419
0
910
SA Night #2 FinatextのSA思想/SA Night #2 Finatext session
satoshiimai
1
150
デスクトップだけじゃないUbuntu
mtyshibata
0
570
【Developers Summit 2025】プロダクトエンジニアから学ぶ、 ユーザーにより高い価値を届ける技術
niwatakeru
2
1.6k
Perlの生きのこり - エンジニアがこの先生きのこるためのカンファレンス2025
kfly8
1
220
Featured
See All Featured
Practical Orchestrator
shlominoach
186
10k
GitHub's CSS Performance
jonrohan
1030
460k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Docker and Python
trallard
44
3.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
250
Building an army of robots
kneath
303
45k
Code Review Best Practice
trishagee
67
18k
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!