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
370
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
630
Programação também é mágica
abdala
0
160
Websockets e você, tudo a ver
abdala
1
120
PHP em todos os lugares
abdala
1
130
Automatizado rotinas com sua linguagem favorita
abdala
0
93
PHPUnit, ele irá te salvar!
abdala
0
80
Presente! Software Livre
abdala
0
68
Other Decks in Technology
See All in Technology
OPENLOGI Company Profile
hr01
0
67k
「Chatwork」の認証基盤の移行とログ活用によるプロダクト改善
kubell_hr
1
230
LangChain Interrupt & LangChain Ambassadors meetingレポート
os1ma
2
180
Fabric + Databricks 2025.6 の最新情報ピックアップ
ryomaru0825
1
150
asken AI勉強会(Android)
tadashi_sato
0
130
MySQL5.6から8.4へ 戦いの記録
kyoshidaxx
1
290
Oracle Audit Vault and Database Firewall 20 概要
oracle4engineer
PRO
3
1.7k
250627 関西Ruby会議08 前夜祭 RejectKaigi「DJ on Ruby Ver.0.1」
msykd
PRO
2
360
作曲家がボカロを使うようにPdMはAIを使え
itotaxi
0
350
本が全く読めなかった過去の自分へ
genshun9
0
660
Witchcraft for Memory
pocke
1
640
ドメイン特化なCLIPモデルとデータセットの紹介
tattaka
1
290
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.3k
Making the Leap to Tech Lead
cromwellryan
134
9.4k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
RailsConf 2023
tenderlove
30
1.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
53k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
GitHub's CSS Performance
jonrohan
1031
460k
Producing Creativity
orderedlist
PRO
346
40k
Visualization
eitanlees
146
16k
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!