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
380
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
670
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
99
PHPUnit, ele irá te salvar!
abdala
0
90
Presente! Software Livre
abdala
0
73
Other Decks in Technology
See All in Technology
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.2k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
200
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
170
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
830
OCI Database Management サービス詳細
oracle4engineer
PRO
1
7.4k
データの整合性を保ちたいだけなんだ
shoheimitani
8
3k
(金融庁共催)第4回金融データ活用チャレンジ勉強会資料
takumimukaiyama
0
140
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
140
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
420
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
690
Featured
See All Featured
BBQ
matthewcrist
89
10k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
We Are The Robots
honzajavorek
0
160
Designing Experiences People Love
moore
144
24k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
Designing for humans not robots
tammielis
254
26k
Producing Creativity
orderedlist
PRO
348
40k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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!