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
今日から始めるAmazon Bedrock AgentCore
har1101
4
400
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.6k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
220
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
650
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
4.7k
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
590
AzureでのIaC - Bicep? Terraform? それ早く言ってよ会議
torumakabe
1
380
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
会社紹介資料 / Sansan Company Profile
sansan33
PRO
15
400k
Context Engineeringの取り組み
nutslove
0
290
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Un-Boring Meetings
codingconduct
0
200
Designing for humans not robots
tammielis
254
26k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The SEO identity crisis: Don't let AI make you average
varn
0
64
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
100
Marketing to machines
jonoalderson
1
4.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.8k
The Curious Case for Waylosing
cassininazir
0
230
HDC tutorial
michielstock
1
360
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
680
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!